-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add Astro content loader for policies #180
Conversation
this pulls from the namesake.fyi policy repo and renders the content to html storing it and the headings metadata in the content layer. This makes it available like so: ```astro --- import { getEntry } from "astro:content"; const entry = await getEntry('policy', 'terms'); const { Content, headings } = await render(entry); --- <Content /> ```
Would resolve #166 |
This is great! I imagine others could benefit from this as well... have you considered publishing an npm package? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works! Nicely done.
Can we also update src/pages/abuse.astro
and src/pages/subprocessors.astro
?
Convert abuse and subprocessors to use content collection
…rk pkg Thankfully the way the markdown package works, we're able to get it with very little need for documenting on our own as it is very straight forward. 1. Get config from LoaderContext 2. Create markdownProcessor 3. Use processor 4. Change the names of the output to match what the data store expects 5. Profit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good! Thanks for leading this :)
You may need to pull from main
and run pnpm i
to resolve the conflicts.
This version takes a config object with repo, username, and a processors object the processors object is just a collection of functions categorized by file extension to process the give file type
Okay, should be all squared now once this is merged in, I'll update the TOC branch and get that finished up too :) |
Removes marked import as well
Thanks so much for your help here @gingerchew! Awesome to see this evolve + use the latest Astro tech + publish a package! Nicely done! |
This pulls from the namesake.fyi policy repo and renders the content to html storing it and the headings metadata in the content layer.
This makes it available like so:
Made a separate PR from the work on the TableOfContents since it was a separate scope.