diff --git a/client/components/ContentBreadcrumbs.vue b/client/components/ContentBreadcrumbs.vue new file mode 100644 index 0000000..06dcf5e --- /dev/null +++ b/client/components/ContentBreadcrumbs.vue @@ -0,0 +1,48 @@ + + + diff --git a/client/content/about.md b/client/content/about.md index e630d6d..de68f25 100644 --- a/client/content/about.md +++ b/client/content/about.md @@ -1 +1,5 @@ +--- +title: About +--- + # Hello Content diff --git a/client/content/about/subpub_stats.md b/client/content/about/subpub_stats.md index 0fa4df1..7afc236 100644 --- a/client/content/about/subpub_stats.md +++ b/client/content/about/subpub_stats.md @@ -1 +1,5 @@ +--- +title: Subpub Statistics +--- + # Subpub Stats diff --git a/client/content/test.md b/client/content/test.md new file mode 100644 index 0000000..38db624 --- /dev/null +++ b/client/content/test.md @@ -0,0 +1,5 @@ +--- +title: Test Is Not In Path +--- + +# my title diff --git a/client/pages/[...slug].vue b/client/pages/[...slug].vue index 1a5a176..e280c54 100644 --- a/client/pages/[...slug].vue +++ b/client/pages/[...slug].vue @@ -1,7 +1,7 @@ diff --git a/client/scripts/generate-content-metadata.ts b/client/scripts/generate-content-metadata.ts index f2f9f5e..2a2a321 100644 --- a/client/scripts/generate-content-metadata.ts +++ b/client/scripts/generate-content-metadata.ts @@ -16,13 +16,13 @@ export type ContentMetadata = Record< string, // path within content directory { mtime: string // timestamp ISO 8601 - } + } | undefined > const markdownMetadataArray = await Promise.all( contentMarkdownPaths.map( (contentMarkdownPath) => - new Promise((resolve, reject) => { + new Promise((resolve) => { git .log({ file: contentMarkdownPath, @@ -30,17 +30,18 @@ const markdownMetadataArray = await Promise.all( strictDate: true }) .then((gitLog) => { - if (gitLog.latest?.date) { - const relativePath = contentMarkdownPath + const relativePath = contentMarkdownPath .substring(contentPath.length) .replace(/\.md$/, '') + if (gitLog.latest?.date) { resolve({ [relativePath]: { mtime: gitLog.latest?.date } }) } else { - reject( + console.warn( `Unable to extract latest Git log time from path ${contentMarkdownPath}` ) + resolve({ [relativePath]: undefined }) } }) })