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

Front matter meta should override .meta.yml defaults #6914

Closed
4 tasks done
rachel-rigdon-sp opened this issue Mar 14, 2024 · 4 comments
Closed
4 tasks done

Front matter meta should override .meta.yml defaults #6914

rachel-rigdon-sp opened this issue Mar 14, 2024 · 4 comments
Labels
bug Issue reports a bug resolved Issue is resolved, yet unreleased if open

Comments

@rachel-rigdon-sp
Copy link
Contributor

Context

I am adding a Discourse comments section to our documentation. I've set the .meta.yml to comments: true and placed it in our docs/ folder, which successfully applied the comments.html override with the Discourse code to all pages in the folder.

However, there are some pages within the folder (like our main index.md) that we don't want comments on.

I've tried excluding them using meta formatting at the top, like:

---
comments: false
---

I've also tried comments: hide and comments: exclude on the individual page, to no avail.

Description

Make the front matter you set on individual pages override the defaults in the .meta.yml

Related links

Use Cases

Author's:

  • Have more fine-grained control over which pages should include/exclude comments, tags, and blog configurations by prioritizing the front matter over the .meta.yml defaults.
  • Be able to include/exclude features without creating a hook.

User's - Will only see features that are useful for specific pages, which can declutter docs and direct focus to the right content.

Visuals

No response

Before submitting

@squidfunk
Copy link
Owner

Thanks for reporting. Indeed, this sounds like unintended behavior! I'll investigate.

@squidfunk squidfunk added the bug Issue reports a bug label Mar 15, 2024
@squidfunk
Copy link
Owner

Fixed in ef7c754a9. This commit changes the meta plugin in that the page metadata is merged last, so that it always takes precedence over any meta files, which should solve the reported problem. I can't be sure, as there's no reproduction attached to this issue, but my testing shows that it should work now. If not, please provide a minimal reproduction.

The meta plugin offers some opportunities for refactoring, which we'll revisit in the future. Feedback like this one is very valuable, so we can decide which direction we need to take it to be as useful as possible ☺️

@squidfunk squidfunk added the resolved Issue is resolved, yet unreleased if open label Mar 16, 2024
@squidfunk
Copy link
Owner

Released as part of 9.5.14+insiders-4.53.2.

@rachel-rigdon-sp
Copy link
Contributor Author

@squidfunk Thank you so much! It's working perfectly! I super appreciate your speedy response and fix. 🙌🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue reports a bug resolved Issue is resolved, yet unreleased if open
Projects
None yet
Development

No branches or pull requests

2 participants