Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ This repository contains documentation for multiple Flanksource projects built w

## Guidelines

- Never write yaml examples directly. The examples/fixtures should come from the submodules mission-control | duty | config-db | canary-checker.
- Never write yaml examples directly in the documentation. Yaml examples on the blog posts are fine though.
The examples/fixtures should come from the submodules mission-control | duty | config-db | canary-checker.
Comment thread
adityathebe marked this conversation as resolved.
use code blocks with file=directive to import the fixtures. Example:

```yaml title="canary.yaml" file=<rootDir>/modules/canary-checker/fixtures/minimal/http_simple.yaml
Expand Down
6 changes: 3 additions & 3 deletions common/src/components/Card.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ export const Card = ({
link,
href,
variant = 'primary',
bordered = true,
padded = true,
sidebar,
children
}) => {
Expand All @@ -26,7 +28,7 @@ export const Card = ({
icon = <Icon name={icon} />
}
const cardContent = (
<div className={clsx(height, "flex border border-slate-200 border-solid hover:border-slate-300 hover:shadow-lg rounded-lg", size == "md" && "p-2 sm:p-5", size == "sm" && "p-1 sm:p-2", size)}>
<div className={clsx(height, "flex rounded-lg", bordered && "border border-slate-200 border-solid hover:border-slate-300 hover:shadow-lg", padded && size == "md" && "p-2 sm:p-5", padded && size == "sm" && "p-1 sm:p-2", size)}>
<div className="items-start flex-col flex-grow justify-around flex">
<span className="flex flex-row items-center space-x-1 ">
{icon && icon}<span className={clsx(size == "md" && 'text-2xl', size == "sm" && "text-xl")}>{title}</span>
Expand All @@ -52,5 +54,3 @@ export const Cards = ({ columns = 3, children }) => {
};




52 changes: 49 additions & 3 deletions common/src/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ html {
--gray-950: #030712;
--font-sans: SuisseIntl, -apple-system, BlinkMacSystemFont, Helvetica, Arial;
--font-serif: 'Merriweather', Georgia, serif;
--font-mono: 'Fira Code', monospace;
--font-mono: ui-monospace, 'SFMono-Regular', 'Cascadia Code', 'Roboto Mono',
Menlo, Monaco, Consolas, 'Liberation Mono', monospace;

--ifm-font-sans: var(--font-sans);
--ifm-font-family-base: var(--font-sans);
Expand Down Expand Up @@ -52,6 +53,7 @@ html {
0px 4px 4px hsla(0, 0%, 0%, 0.16), 0px 4px 2px hsla(0, 0%, 0%, 0.04);
--white: white;
--ifm-font-size-base: 16px;
--ifm-font-family-monospace: var(--font-mono);
--ifm-code-font-size: 14px;
--ifm-font-color-base: #061431;
--ifm-color-primary: #3578e5;
Expand Down Expand Up @@ -267,6 +269,11 @@ footer {
font-size: 1.1rem;
}

article .markdown h2,
article .markdown h3 {
font-weight: 400;
}

h4,
h5,
h6 {
Expand All @@ -289,6 +296,40 @@ footer {
}
}

@media (max-width: 996px) {
.navbar__items--right
> a[href^='https://demo.flanksource.com/'],
.navbar__items--right > a[href='https://app.flanksource.com/'] {
display: none;
}

.navbar__items--right
> a[href^='https://accounts.flanksource.com/sign-up'] {
margin-right: 2.5rem;
margin-left: auto;
}

.blog-post-page .theme-code-block [class*='codeBlockContent'],
.blog-post-page .theme-code-block pre,
.blog-post-page .theme-code-block pre code {
width: 100%;
max-width: 100%;
min-width: 0;
}
Comment thread
adityathebe marked this conversation as resolved.

footer [class~='gap-x-[1.88rem]'] {
flex-direction: column;
align-items: flex-start;
}

footer [class~='gap-x-[5.63rem]'] {
width: 100%;
max-width: 100%;
flex-wrap: wrap;
column-gap: 2rem;
}
}

.hidden {
display: none;
}
Expand Down Expand Up @@ -551,6 +592,13 @@ li.popular > a::after {
padding: 0px !important ;
}

.theme-code-block pre,
.theme-code-block pre code {
font-family: var(--font-mono);
font-size: var(--ifm-code-font-size);
line-height: 1.5;
}

span.step-container {
margin-top: 10px;
}
Expand Down Expand Up @@ -958,5 +1006,3 @@ html[data-theme='dark'] .header-github-link:before {
transform: scale(1.05);
filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1)) brightness(1.05);
}


7 changes: 2 additions & 5 deletions common/src/theme/BlogPostItem/Card/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,13 @@ function useContainerClassName() {
export default function BlogPostCard({ children, post, url, }) {
const containerClassName = useContainerClassName();
return (
<Card link={post.metadata.permalink} height="h-64">
<Card link={post.metadata.permalink} height="h-64" bordered={false} padded={false}>
<BlogPostItemContainer >
<BlogPostItemHeader />
<span className='text-gray-900 line-clamp-2 pb-2'>{post.metadata.description}</span>
<span className='text-left text-gray-900 line-clamp-2 mb-2'>{post.metadata.description}</span>
<TagsListInline tags={post.metadata.tags} />
</BlogPostItemContainer >
</Card>

);
}



4 changes: 2 additions & 2 deletions common/src/theme/BlogPostItem/Footer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ export default function BlogPostItemFooter() {
lastUpdatedBy={lastUpdatedBy}
/>
)}
<span className='flex text-slate-500 font-light uppercase'>Written By</span>
<BlogPostItemHeaderAuthors short={false} />
<span className='margin-top--lg flex text-slate-500 font-light uppercase'>Written By</span>
<BlogPostItemHeaderAuthors short={false} compact />
{tagsExists && (
<TagsListInline tags={tags} />
)}
Expand Down
4 changes: 2 additions & 2 deletions common/src/theme/BlogPostItem/Header/Authors/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useBlogPost } from '@docusaurus/plugin-content-blog/client';
import BlogAuthor from '@theme/Blog/Components/Author';
import styles from './styles.module.css';
// Component responsible for the authors layout
export default function BlogPostItemHeaderAuthors({ className, short = false }) {
export default function BlogPostItemHeaderAuthors({ className, short = false, compact = false }) {
const {
metadata: { authors },
assets,
Expand All @@ -18,7 +18,7 @@ export default function BlogPostItemHeaderAuthors({ className, short = false })
return (
<div
className={clsx(
'margin-top--md margin-bottom--sm',
compact ? 'margin-top--sm margin-bottom--sm' : 'margin-top--md margin-bottom--sm',
imageOnly ? styles.imageOnlyAuthorRow : 'row',
className,
)}>
Expand Down
26 changes: 16 additions & 10 deletions common/src/theme/BlogPostItem/Header/Title/index.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
import React from 'react';
import clsx from 'clsx';
import Link from '@docusaurus/Link';
import { useBlogPost } from '@docusaurus/plugin-content-blog/client';
import styles from './styles.module.css';
import React from 'react'
import clsx from 'clsx'
import Link from '@docusaurus/Link'
import { useBlogPost } from '@docusaurus/plugin-content-blog/client'
import styles from './styles.module.css'
export default function BlogPostItemHeaderTitle({ className }) {
const { metadata, isBlogPostPage } = useBlogPost();
const { permalink, title } = metadata;
const TitleHeading = isBlogPostPage ? 'h1' : 'h2';
const { metadata, isBlogPostPage } = useBlogPost()
const { permalink, title } = metadata
const TitleHeading = isBlogPostPage ? 'h1' : 'h2'
return (
<TitleHeading className={clsx(styles.title, className, isBlogPostPage && "pt-10")}>
<TitleHeading
className={clsx(
styles.title,
isBlogPostPage && styles.postTitle,
className
)}
>
{isBlogPostPage ? title : <Link to={permalink}>{title}</Link>}
</TitleHeading>
);
)
}
13 changes: 12 additions & 1 deletion common/src/theme/BlogPostItem/Header/Title/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,22 @@
font-size: 3rem;
}

.title.postTitle {
max-width: 1000px;
margin: 0 auto;
font-size: 48px;
font-weight: 400;
letter-spacing: -0.045em;
line-height: 1;
text-wrap: balance;
}
Comment thread
adityathebe marked this conversation as resolved.

/**
Blog post title should be smaller on smaller devices
**/
@media (max-width: 576px) {
.title {
.title,
.title.postTitle {
font-size: 2rem;
}
}
25 changes: 14 additions & 11 deletions common/src/theme/BlogPostItem/Header/index.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
import React from 'react';
import BlogPostItemHeaderTitle from '@theme/BlogPostItem/Header/Title';
import BlogPostItemHeaderInfo from '@theme/BlogPostItem/Header/Info';
import BlogPostItemHeaderAuthors from '@theme/BlogPostItem/Header/Authors';
import { useBlogPost } from '@docusaurus/plugin-content-blog/client';
import clsx from 'clsx';
import React from 'react'
import BlogPostItemHeaderTitle from '@theme/BlogPostItem/Header/Title'
import BlogPostItemHeaderInfo from '@theme/BlogPostItem/Header/Info'
import BlogPostItemHeaderAuthors from '@theme/BlogPostItem/Header/Authors'
import { useBlogPost } from '@docusaurus/plugin-content-blog/client'
import clsx from 'clsx'
import styles from './styles.module.css'

export default function BlogPostItemHeader() {
const { isBlogPostPage } = useBlogPost()

return (
<header className={clsx()}>
{/* Blog: {blog} */}
<header className={clsx(isBlogPostPage && styles.postHeader)}>
{isBlogPostPage && <BlogPostItemHeaderInfo className={styles.postInfo} />}
<BlogPostItemHeaderTitle />
<BlogPostItemHeaderInfo />
<BlogPostItemHeaderAuthors short={true} />
{!isBlogPostPage && <BlogPostItemHeaderInfo />}
{!isBlogPostPage && <BlogPostItemHeaderAuthors short={true} />}
</header>
);
)
}
13 changes: 13 additions & 0 deletions common/src/theme/BlogPostItem/Header/styles.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.postHeader {
Comment thread
adityathebe marked this conversation as resolved.
width: min(100%, calc(100vw - 2rem));
max-width: 1100px;
box-sizing: border-box;
margin: 0 auto;
padding: clamp(4rem, 9vw, 7rem) 1rem clamp(2rem, 4vw, 3rem);
text-align: center;
}

.postInfo {
margin-bottom: 2rem;
color: var(--ifm-color-emphasis-700);
}
45 changes: 32 additions & 13 deletions common/src/theme/BlogPostItem/index.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,41 @@
import React from 'react';
import clsx from 'clsx';
import {useBlogPost} from '@docusaurus/plugin-content-blog/client';
import BlogPostItemContainer from '@theme/BlogPostItem/Container';
import BlogPostItemHeader from '@theme/BlogPostItem/Header';
import BlogPostItemContent from '@theme/BlogPostItem/Content';
import BlogPostItemFooter from '@theme/BlogPostItem/Footer';
// apply a bottom margin in list view
import React from 'react'
import clsx from 'clsx'
import { useBlogPost } from '@docusaurus/plugin-content-blog/client'
import BlogPostItemContainer from '@theme/BlogPostItem/Container'
import BlogPostItemHeader from '@theme/BlogPostItem/Header'
import BlogPostItemContent from '@theme/BlogPostItem/Content'
import BlogPostItemFooter from '@theme/BlogPostItem/Footer'
import styles from './styles.module.css'

function useContainerClassName() {
const {isBlogPostPage} = useBlogPost();
return !isBlogPostPage ? 'margin-bottom--xl' : undefined;
const { isBlogPostPage } = useBlogPost()
return !isBlogPostPage ? 'margin-bottom--xl' : undefined
}
export default function BlogPostItem({children, className}) {
const containerClassName = useContainerClassName();
export default function BlogPostItem({ children, className, toc }) {
const containerClassName = useContainerClassName()

if (toc) {
return (
<BlogPostItemContainer
className={clsx(containerClassName, className, styles.postArticle)}
>
<BlogPostItemHeader />
<div className={styles.postBody}>
<div className={styles.postContent}>
<BlogPostItemContent>{children}</BlogPostItemContent>
<BlogPostItemFooter />
</div>
<aside className={styles.postToc}>{toc}</aside>
</div>
</BlogPostItemContainer>
)
}

return (
<BlogPostItemContainer className={clsx(containerClassName, className)}>
<BlogPostItemHeader />
<BlogPostItemContent>{children}</BlogPostItemContent>
<BlogPostItemFooter />
</BlogPostItemContainer>
);
)
}
30 changes: 30 additions & 0 deletions common/src/theme/BlogPostItem/styles.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
.postArticle.postArticle {
width: calc(100vw - 2rem);
Comment thread
adityathebe marked this conversation as resolved.
max-width: 1200px;
}

.postBody {
display: grid;
grid-template-columns: minmax(0, 900px) minmax(180px, 220px);
gap: 3rem;
align-items: start;
}

.postContent {
min-width: 0;
}

.postToc {
min-width: 0;
align-self: stretch;
}

@media (max-width: 996px) {
.postBody {
display: block;
}

.postToc {
display: none;
}
}
4 changes: 1 addition & 3 deletions common/src/theme/BlogPostItems/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ export default function BlogPostItems({
component: BlogPostItemComponent = BlogPostItem,
}) {
return (
<div className='pt-10 container text--center'>
<h1>Flanksource Blog</h1>
<div className='pt-16 container'>
<Cards>
{items.map(({ content: BlogPostContent }) => (
<BlogPostProvider
Expand All @@ -25,4 +24,3 @@ export default function BlogPostItems({
</div>
);
}

Loading
Loading