Pull markdown from a specific doc onto docs Home index #485
Unanswered
RickCogley
asked this question in
Q&A
Replies: 1 comment
-
Check the example from the documentation or Check my PR #1479 for the details but in short: // Relative path to the markdown file
const url = new URL(`../../docs/faq.md`,import.meta.url);
// Read the markdown file as text
const text = await Deno.readTextFile(url)
// Interpret text as frontMatter markup
const { body } = frontMatter<Record<string,unknown>>(text) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Appreciate any hints on this as I'm a newb to deno and Fresh.
I am trying to leverage the techniques in the Fresh documents site in the www folder as a base for a site. The Home page (
/www/routes/index.tsx
), with the cool LemonDrop animation is great, but would not be relevant for what I'm trying to make, so I will rewrite it.The singleton route (
/www/routes/docs/[...slug].tsx
) takes the slug as input and shows the document with a TOC sidebar and markdown etc pulled from a markdown file (e.g./www/docs/introduction/index.md
).How can I pull markdown from a specific
.md
file like (/www/docs/introduction/index.md
) and display that on the index page? I don't need a map of all pages but rather just the markdown from a single specific one.Can someone please help?
Beta Was this translation helpful? Give feedback.
All reactions