Skip to content

Commit

Permalink
feat: show blog description in preview
Browse files Browse the repository at this point in the history
  • Loading branch information
dennyabrain committed May 3, 2024
1 parent b663fbc commit 2678e1f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/components/atomic/AppShell.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,15 @@ const AppShell = ({
expandCenter,
contentWidth,
isMDXPage,
meta,
}) => {
const size = React.useContext(ResponsiveContext)
const [modal, setModal] = useState({ visibility: false, text: "" })

return (
<Grommet theme={TattleTheme} full>
<Box fill direction={"column"}>
<SEO title={`Tattle`} heading={headerLabel} />
<SEO title={`Tattle`} heading={headerLabel} meta={meta} />
{/* {location.pathname !== MODAL_PATH && (
<Box
background={"accent-1"}
Expand Down
5 changes: 3 additions & 2 deletions src/components/atomic/seo.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ function SEO({ description, lang, meta, title, heading }) {
}
`)

const metaDescription = description || site.siteMetadata.description
const author = site.siteMetadata.author
const metaDescription =
meta.excerpt || description || site.siteMetadata.description
const author = meta.author || site.siteMetadata.author
const baseURL = site.siteMetadata.base_url

let socialImageURLs = {}
Expand Down
3 changes: 2 additions & 1 deletion src/components/default-blog-layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const shortcodes = {
}

export default function PageTemplate({ data: { mdx, allMdx } }) {
const { name, author, project, date } = mdx.frontmatter
const { name, author, project, date, excerpt } = mdx.frontmatter
const tags = mdx.frontmatter.tags
? mdx.frontmatter.tags.split(",").map(tag => tag.trim())
: []
Expand Down Expand Up @@ -54,6 +54,7 @@ export default function PageTemplate({ data: { mdx, allMdx } }) {
primaryNav={primaryNav}
expandCenter={true}
isMDXPage={true}
meta={{ name: name, excerpt: excerpt, project: project, tags: tags }}
>
<MDXProvider components={shortcodes}>
<Box>
Expand Down

0 comments on commit 2678e1f

Please sign in to comment.