mirror of
https://github.com/Unkn0wnCat/KevinK.dev.js.git
synced 2025-05-10 15:36:57 +02:00
Add blog post
This commit is contained in:
parent
a22002c150
commit
d39e41cf4b
14 changed files with 188 additions and 32 deletions
|
@ -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
|
||||
|
|
|
@ -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 } }) {
|
||||
|
|
|
@ -1,7 +1,14 @@
|
|||
@import "../globals";
|
||||
|
||||
.scamboxSection {
|
||||
.postSection {
|
||||
flex-grow: 1;
|
||||
|
||||
> article {
|
||||
img {
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.noticeBox {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue