diff --git a/generator/page-list-generator.ts b/generator/page-list-generator.ts index 7a91c89..d01a9dd 100644 --- a/generator/page-list-generator.ts +++ b/generator/page-list-generator.ts @@ -26,8 +26,9 @@ export default function pageListGenerator(routeBase: string[]): PluginOption { .map((entry) => { return { entry, frontmatter: matter.read(entry, { excerpt: true }) } }) - .map((file): PageData => { + .map((file): PageData | undefined => { const { entry, frontmatter } = file + if (frontmatter.data.hidden) return undefined const filename = path.parse(entry).name const data = frontmatter.data const time = data.time @@ -45,6 +46,7 @@ export default function pageListGenerator(routeBase: string[]): PluginOption { contentUrl: `/${base}/${filename}`, } }) + .filter((page) => page !== undefined) .sort((a, b) => Date.parse(b.time) - Date.parse(a.time)), }) } diff --git a/src/data/activities/referenced-markdown-content.md b/src/data/activities/referenced-markdown-content.md new file mode 100644 index 0000000..945600f --- /dev/null +++ b/src/data/activities/referenced-markdown-content.md @@ -0,0 +1,13 @@ +--- +hidden: true +--- + +**BEGIN IMPORTED SECTION** + +### This section is from an external markdown file + +::: info +testing whether we could import an external markdown file. +::: + +**END IMPORTED SECTION** diff --git a/src/data/activities/the-ultimate-markdown-benchmark.md b/src/data/activities/the-ultimate-markdown-benchmark.md index 9aaf5ee..caa0b8e 100644 --- a/src/data/activities/the-ultimate-markdown-benchmark.md +++ b/src/data/activities/the-ultimate-markdown-benchmark.md @@ -75,6 +75,14 @@ def hello_world(): ## Extended Markdown Syntax +### Importing External Markdown Files + +The file is [here](./referenced-markdown-content) + +