diff --git a/src/pages/blog/[...slug].astro b/src/pages/blog/[...slug].astro index 5396a57..33b9d6e 100644 --- a/src/pages/blog/[...slug].astro +++ b/src/pages/blog/[...slug].astro @@ -19,12 +19,16 @@ export async function getStaticPaths() { } const { entry } = Astro.props; -const { Content, headings } = await entry.render(); +const { Content, headings, remarkPluginFrontmatter } = await entry.render(); const noscript = siteConfig.noClientJavaScript const slug = Astro.params.slug; const author = Array.isArray(entry.data.author) ? entry.data.author : (entry.data.author !== undefined ? [entry.data.author] : [{collection: 'authors', id: siteConfig.defaultAuthor.id}]); +// Get Wordcount and Last Updated Date +const wordcount = remarkPluginFrontmatter.wordcount; +const lastUpdated = remarkPluginFrontmatter.lastModified; + // Get author data const authorData = await Promise.all((author).map((singleAuthor) => getEntry(singleAuthor).then(authorEntry => authorEntry?.data))) const authorInfo = authorData.includes(undefined) ? [{data: siteConfig.defaultAuthor}] : authorData; @@ -53,6 +57,9 @@ const cover = customFeaturedImage || matchedImage_src?.src || firstImageURL || `
{entry.data.summary}
}