Repository navigation
Fix variable examples in reusable content docs - #46876
Draft
ZainnQureshii wants to merge 1 commit into
Draft
ZainnQureshii wants to merge 1 commit into
ZainnQureshii wants to merge 1 commit into
Conversation
Data tags for variables need the variables. prefix, the last two segments of a tag are read as the file and the key so nested keys do not resolve, and a bare 42 loads as a number, which gray-matter rejects, so the documented tags did not render. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
How to review these changes 👓Thank you for your contribution. To review these changes, choose one of the following options: A Hubber will need to deploy your changes internally to review. Table of review linksNote: Please update the URL for your staging server or codespace. The table shows the files in the
Key: fpt: Free, Pro, Team; ghec: GitHub Enterprise Cloud; ghes: GitHub Enterprise Server 🤖 This comment is automatically generated. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why:
Closes: #46875
What's being changed (if available, include any code snippets, screenshots, or gifs):
The variables example in
creating-reusable-content.mdand indata/variables/README.mdshows tags that do not resolve, so this updates both copies. The tags now start withvariables., whichgetDataByDirinsrc/data-directory/lib/get-data.tsneeds before it readsdata/variables/, and the nested block is replaced with a second top-level key, because the last two segments of the tag are taken as the file and the key.42is quoted as well, since a bare number reaches gray-matter as a number and it throws "expected input to be a string or buffer".I checked it by running the current
getDataByDiragainst afoo/bar.ymlfixture with the repo's js-yaml (5.4.1, the version inpackage-lock.json) and@gr2m/gray-matter(4.0.3-with-pr-137). The old tags fail and{% data variables.foo.bar.meaning_of_life %}and{% data variables.foo.bar.affirmative %}render42andYes!. I did not run the full site or its linters locally, because they need Node 26.AI disclosure: Claude Code (Anthropic) found and traced this, made the change and wrote this description. Could a maintainer add the
llm-generatedlabel, please?Check off the following:
🤖 Generated with Claude Code