Skip to content
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

Injected frontmatter change #2250

Merged
merged 13 commits into from
Jan 3, 2023
Merged

Conversation

bholmesdev
Copy link
Contributor

@bholmesdev bholmesdev commented Dec 28, 2022

What kind of changes does this PR include?

  • New or updated content

Description

  • Bump injected frontmatter to an L3 heading, and rename to "modifying frontmatter programmatically." Users have typically asked how to "modify" frontmatter in support forums. Adding a TOC entry with "modifying" instead of "injection" may help discoverability!
  • Add tip that data.astro.frontmatter now includes all document frontmatter properties

@netlify
Copy link

netlify bot commented Dec 28, 2022

Deploy Preview for astro-docs-2 ready!

Name Link
🔨 Latest commit 0a2805d
🔍 Latest deploy log https://app.netlify.com/sites/astro-docs-2/deploys/63b4b22829518800092e3021
😎 Deploy Preview https://deploy-preview-2250--astro-docs-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@bholmesdev bholmesdev force-pushed the edit/injected-frontmatter-new-default branch from 2cc7d70 to 89eda6c Compare December 28, 2022 16:12
@@ -830,7 +830,7 @@ A function to compile a given Markdown or MDX document for rendering. This retur

- `<Content />` - A component used to render the document's contents in an Astro file.
- `headings` - A generated list of headings, [mirroring Astro's `getHeadings()` utility](/en/guides/markdown-content/#exported-properties) on Markdown and MDX imports.
- `injectedFrontmatter ` - An object of frontmatter [injected via remark or rehype plugins](/en/guides/markdown-content/#example-injecting-frontmatter). Set to type `any`.
- `injectedFrontmatter ` - An object of frontmatter [modified via remark or rehype plugins](/en/guides/markdown-content/#modifying-frontmatter-programmatically). Set to type `any`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just checking that you still want to name this injectedFrontmatter even though all our descriptions now refer to it as "modified frontmatter"? (I understand that changing the code is probably a bigger deal than changing words in the docs. Just pointing it out!)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm aware, and I'm debating a good name for it 😓
pluginFrontmatter is the rough name I'm going with?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update: decided on remarkPluginFrontmatter! Remark is the umbrella for "remark and rehype plugins" according to the unified spec. Also want to clarify this is the frontmatter from remark only, and won't reflect any schemas you have applied.

@github-actions github-actions bot added the i18n Anything to do with internationalization & translation efforts - ask @YanThomas for help! label Dec 28, 2022
@github-actions github-actions bot removed the i18n Anything to do with internationalization & translation efforts - ask @YanThomas for help! label Dec 28, 2022
Copy link
Member

@sarah11918 sarah11918 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, @bholmesdev! I think the change is so great for usablility! 🚀

Some non-blocking comments for thought!

src/pages/en/guides/markdown-content.mdx Outdated Show resolved Hide resolved
src/pages/en/reference/api-reference.mdx Outdated Show resolved Hide resolved
bholmesdev and others added 2 commits December 28, 2022 17:27
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
@sarah11918 sarah11918 added the improve documentation Enhance existing documentation (e.g. add an example, improve description) label Dec 29, 2022
@sarah11918 sarah11918 merged commit 621b9f0 into main Jan 3, 2023
@sarah11918 sarah11918 deleted the edit/injected-frontmatter-new-default branch January 3, 2023 23:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improve documentation Enhance existing documentation (e.g. add an example, improve description)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants