Add blog post

This commit is contained in:
Kevin Kandlbinder 2021-12-24 02:16:54 +00:00 committed by GitHub
parent a22002c150
commit d39e41cf4b
14 changed files with 188 additions and 32 deletions

View file

@ -147,7 +147,10 @@ export const query = graphql`
posts: allFile(
filter: {
sourceInstanceName: { eq: "blogContent" }
childMdx: { frontmatter: { section: { eq: $section } } }
childMdx: {
body: { ne: null }
frontmatter: { section: { eq: $section } }
}
}
sort: { fields: childMdx___frontmatter___published, order: DESC }
limit: $limit

View file

@ -58,7 +58,7 @@ const BlogPost = ({ data }) => {
},
]}
>
<section className={styles.scamboxSection}>
<section className={styles.postSection}>
<article>
<h1>{data.mdx.frontmatter.title}</h1>
<span className={styles.meta}>
@ -82,7 +82,13 @@ const BlogPost = ({ data }) => {
</span>
<MDXProvider components={{ Chat }}>
<MDXRenderer>{data.mdx.body}</MDXRenderer>
<MDXRenderer
localImages={
data.mdx.frontmatter.embeddedImagesLocal
}
>
{data.mdx.body}
</MDXRenderer>
</MDXProvider>
<Utterances
@ -124,6 +130,12 @@ export const query = graphql`
name
}
section
embeddedImagesLocal {
childImageSharp {
gatsbyImageData
}
publicURL
}
}
}
locales: allLocale(filter: { language: { eq: $language } }) {

View file

@ -1,7 +1,14 @@
@import "../globals";
.scamboxSection {
.postSection {
flex-grow: 1;
> article {
img {
display: block;
margin: 0 auto;
}
}
}
.noticeBox {