Skip to content

chore: Move mdnsidebar into front matter #39274

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 8 commits into from
Apr 28, 2025
Merged

chore: Move mdnsidebar into front matter #39274

merged 8 commits into from
Apr 28, 2025

Conversation

bsmth
Copy link
Member

@bsmth bsmth commented Apr 25, 2025

Description

There are leftovers in this section that we should clean up.
Using front matter in all /mdn pages instead of macro has the side-effect that the page content should be updated, too.

Updating templates to use front matter for non-parameterized sidebars, this will likely be the default going forward.

Motivation

Fewer macros embedded in prose and page layout / type defined in front matter.

Related issues and pull requests

@bsmth bsmth requested a review from a team as a code owner April 25, 2025 11:13
@bsmth bsmth requested review from hamishwillee and removed request for a team April 25, 2025 11:13
@github-actions github-actions bot added the Content:Meta Content in the meta docs label Apr 25, 2025
@bsmth bsmth requested a review from Josh-Cena April 25, 2025 11:14
@github-actions github-actions bot added the size/m [PR only] 51-500 LoC changed label Apr 25, 2025
Copy link
Contributor

github-actions bot commented Apr 25, 2025

Preview URLs (17 pages)
Flaws (3)

Note! 14 documents with no flaws that don't need to be listed. 🎉

URL: /en-US/docs/MDN/Writing_guidelines/Learning_content
Title: Learn web development writing guidelines
Flaw count: 1

  • broken_links:
    • /en-US/docs/Learn_web_development/Core/Structuring_content/HTML_images/Test_your_skills:_HTML_images is a redirect

URL: /en-US/docs/MDN/Writing_guidelines/Page_structures/Page_types/CSS_function_page_template
Title: CSS function page template
Flaw count: 1

  • macros:
    • Macro produces link /en-US/docs/Web/HTML/Element/dl which is a redirect

URL: /en-US/docs/MDN/Writing_guidelines/Page_structures/Page_types/Page_type_key
Title: The page-type front matter key
Flaw count: 1

  • broken_links:
    • /en-US/docs/Learn_web_development/Extensions/Forms/Test_your_skills:_Basic_controls is a redirect
External URLs (2)

URL: /en-US/docs/MDN/Writing_guidelines/Howto/JSON_Structured_data
Title: How to use structured data


URL: /en-US/docs/MDN/Writing_guidelines/Page_structures/Page_types/ARIA_Page_Template
Title: ARIA page template

(comment last updated: 2025-04-28 09:53:32)

@@ -64,17 +66,14 @@ sidebar: mdnsidebar
> - `\{{SecureContext_Header}}` — this generates a **Secure context** banner that indicates the technology is only available in a [secure context](/en-US/docs/Web/Security/Secure_Contexts).
Copy link
Member

Choose a reason for hiding this comment

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

I think we should remove this (and the one in SVG element). Elements don't make sense to be secure-context-only. And then we can remove the whole "You should update or delete the following macros according to the advice below:" part.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes ^^^

Copy link
Member Author

Choose a reason for hiding this comment

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

done in 8c34575

@@ -3,10 +3,9 @@ title: Learn web development writing guidelines
short-title: Learning content
slug: MDN/Writing_guidelines/Learning_content
page-type: mdn-writing-guide
sidebar: mdnsidebar
Copy link
Collaborator

@hamishwillee hamishwillee Apr 28, 2025

Choose a reason for hiding this comment

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

Just "FWIW", we no longer need to include sidebar in the name if we're always referencing a sidebar. I.e. this would have been better as

sidebar: mdn

It made sense for macros since we had macros with different purposes.

I do much prefer this approach!

Copy link
Member Author

Choose a reason for hiding this comment

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

Just "FWIW", we no longer need to include sidebar in the name if we're always referencing a sidebar. I.e. this would have been better as

sidebar: mdn

Yeah this is really leftovers due to migrating everything from Yari land, naming was kept so existing sidebars worked in the new world. I think we've broken that convention in some cases (like in the Privacy section -> #38269) - and totally agree this is much nicer not to have to duplicate 'sidebar' if possible :)

bsmth and others added 3 commits April 28, 2025 11:29
…css_property_page_template/index.md

Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
@bsmth
Copy link
Member Author

bsmth commented Apr 28, 2025

Thanks, both! I'm going to merge now to get the changes in, but I think we can revisit the templates in general. I don't really like stuffing everything into a note block in the top of the page, and there's a lot of duplication. Compared to https://pr39274.review.mdn.allizom.net/en-US/docs/MDN/Writing_guidelines/Page_structures/Page_types/ARIA_Page_Template which is a bit easier to read, that's an improvement, IMO. Or we can look at actual templating that rari can consume / produce.

@bsmth bsmth merged commit da12dd7 into mdn:main Apr 28, 2025
8 checks passed
@bsmth bsmth deleted the mdnsidebar-fm branch April 28, 2025 09:59
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Content:Meta Content in the meta docs size/m [PR only] 51-500 LoC changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants