Skip to content

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

@thescientist13

Description

@thescientist13

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. 🤞

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfast followCarryovers from the launch milestone

    Type

    Projects

    Status

    📋 Backlog

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions