Fix invalid YAML escape sequence in wikilinks with aliases#746
Open
recursivefaults wants to merge 1 commit intooleeskild:mainfrom
Open
Fix invalid YAML escape sequence in wikilinks with aliases#746recursivefaults wants to merge 1 commit intooleeskild:mainfrom
recursivefaults wants to merge 1 commit intooleeskild:mainfrom
Conversation
Wikilinks with aliases were being output as [[path\|alias]] with an
escaped pipe character. This caused YAML parsing errors in Eleventy
because \| is not a valid escape sequence in JSON/YAML strings.
Changed to use plain pipe [[path|alias]] which:
- Produces valid YAML frontmatter
- Works with the site template's split("|") link parsing
- Matches how the plugin already parses incoming wikilinks
Added comprehensive tests:
- FrontmatterCompiler tests for YAML validity
- GardenPageCompiler tests for wikilink conversion
- Integration tests using the test vault
Co-Authored-By: Claude Opus 4.5 <[email protected]>
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.
In front matter, wikilinks with aliases were being output as [[path|alias]] with an escaped pipe character. This caused YAML parsing errors in Eleventy because | is not a valid escape sequence in JSON/YAML strings.
Background
Right now, digital-garden doesn't have any SEO friendly meta tags or open graph tags. I've customized my template to include that, which requires custom front matter on my notes. This also, then, requires me to pass front matter through. Builds were failing due to the plugin not being able to parse links in the front matter.
A future change could be to include SEO based fields and a robots.txt as a part of the plugin configuration, but that is a lot bigger of a change than this.
Fix
Changed to use plain pipe [[path|alias]] which:
Added comprehensive tests: