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

docs: document global variables in MDX scope #5900

Merged
merged 2 commits into from Nov 7, 2021

Conversation

Josh-Cena
Copy link
Collaborator

Motivation

Complete #5200 because that can't be merged without CLA and doesn't look like the author is ever responding.

Have you read the Contributing Guidelines on pull requests?

Yes

@netlify
Copy link

netlify bot commented Nov 7, 2021

✔️ [V2]

🔨 Explore the source changes: 0b3c139

🔍 Inspect the deploy log: https://app.netlify.com/sites/docusaurus-2/deploys/6187ec7c09e8a70008190705

😎 Browse the preview: https://deploy-preview-5900--docusaurus-2.netlify.app

@github-actions
Copy link

github-actions bot commented Nov 7, 2021

⚡️ Lighthouse report for the changes in this PR:

Category Score
🟠 Performance 76
🟢 Accessibility 98
🟢 Best practices 100
🟢 SEO 100
🟢 PWA 95

Lighthouse ran on https://deploy-preview-5900--docusaurus-2.netlify.app/

@github-actions
Copy link

github-actions bot commented Nov 7, 2021

Size Change: -3 B (0%)

Total Size: 881 kB

ℹ️ View Unchanged
Filename Size Change
website/.docusaurus/globalData.json 38.2 kB 0 B
website/build/assets/css/styles.********.css 94 kB 0 B
website/build/assets/js/main.********.js 474 kB 0 B
website/build/blog/2017/12/14/introducing-docusaurus/index.html 66.1 kB 0 B
website/build/blog/index.html 36.8 kB 0 B
website/build/docs/index.html 44 kB 0 B
website/build/docs/installation/index.html 51.5 kB -3 B (0%)
website/build/index.html 29.5 kB 0 B
website/build/tests/docs/index.html 25.2 kB 0 B
website/build/tests/docs/standalone/index.html 21.7 kB 0 B

compressed-size-action

@Josh-Cena
Copy link
Collaborator Author

I didn't document the __filename variable because when we migrate to ESM it may be lost (didn't investigate), and when I tested it points to index.js with no other information, and I think because this is ultimately client-side it's not going to be hugely useful.

assets and metadata are not documented either because they may be changed in the future. The other variables are more useful for the client-side user.

@Josh-Cena Josh-Cena changed the title docs: explain how to access frontMatter within pages docs: document global variables in MDX scope Nov 7, 2021
@Josh-Cena Josh-Cena merged commit 0fc7adf into main Nov 7, 2021
@Josh-Cena Josh-Cena deleted the jc/document-frontMatter-in-MD branch November 7, 2021 15:16
@Josh-Cena Josh-Cena added the pr: documentation This PR works on the website or other text documents in the repo. label Nov 7, 2021
@slorber
Copy link
Collaborator

slorber commented Nov 9, 2021

Thanks, makes sense

Not even sure we should document contentTitle though, any use-case in mind to want to use it?

@Josh-Cena
Copy link
Collaborator Author

Not even sure we should document contentTitle though, any use-case in mind to want to use it?

No, but it's just such a simple API and I don't expect it to change in the future😄 And it's less than useless compared to __filename

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: documentation This PR works on the website or other text documents in the repo.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants