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

cleaner solution for handling active frontmatter title examples on docs and guide pages displaying as null #125

Open
thescientist13 opened this issue Oct 31, 2024 · 0 comments
Labels
bug Something isn't working fast follow Carryovers from the launch milestone good first issue Good for newcomers

Comments

@thescientist13
Copy link
Member

thescientist13 commented Oct 31, 2024

Summary

Observed as part of #117 that when we had an example in the documentation that was demonstrating use of ${globalThis.page.title}

<html>
  <head>
    <title>My Blog - ${globalThis.page.title}</title>
    <meta property="og:title" content="My Blog - ${globalThis.page.title}" />
  </head>

  <!-- ... -->
</html>

Greenwood was (as designed) replacing that value, and so it comes out as a a literal null value right in the docs itself
Screenshot 2024-10-31 at 11 29 37 AM

What we want is to leave the value alone
Screenshot 2024-10-31 at 12 03 23 PM

Current pages impacted

  • /docs/content-as-data/active-frontmatter/#usage
  • /guides/getting-started/going-further/#content-as-data

Details

As can be seen in the last screenshot above, an interim solution was put in place that was basically just creating a Greenwood plugin to match on the couple of instances this was happening for in our docs, and put the value back.

I had hoped that maybe I could have used an escape sequence, like for the $ to "trick" Greenwood into not matching on this

<title>My Blog - $&#36;{globalThis.page.title}</title>

but all the entities stay as their literal values 😞
Screenshot 2024-10-31 at 11 31 18 AM

Not sure if there is a nicer way to fix this through some cool markdown trick but would be nice to find out. 🤞

@thescientist13 thescientist13 added bug Something isn't working good first issue Good for newcomers labels Oct 31, 2024
@thescientist13 thescientist13 changed the title active frontmatter title examples getting set to null in docs and guides examples active frontmatter title examples on docs and guide pages getting set to null Oct 31, 2024
@thescientist13 thescientist13 changed the title active frontmatter title examples on docs and guide pages getting set to null cleaner solution for handling active frontmatter title examples on docs and guide pages displaying as null Oct 31, 2024
@thescientist13 thescientist13 added the fast follow Carryovers from the launch milestone label Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fast follow Carryovers from the launch milestone good first issue Good for newcomers
Projects
Status: 📋 Backlog
Development

No branches or pull requests

1 participant