Keep the Jekyll variable in the downloads page out of the preprocessing - #19
Merged
Conversation
The link to the validation overview on the downloads page was built from
site.data.fhir.path, which the IG publisher fills in with the base URL of the
FHIR release. downloads.liquid.md is a template, though, so the preprocessing
renders it before Jekyll ever sees it, and liquidjs resolves the expression
against context-<Rx>.json. There is no site variable there, so it became the
empty string and the link pointed at validation.html inside the guide, which
does not exist:
ERROR: downloads.html ... The link 'validation.html' for "validating FHIR
profiles and resources" cannot be resolved
Wrapping the expression in {% raw %} hands it through the first pass. The tag
is consumed there, so Jekyll receives a plain expression and resolves it to
http://hl7.org/fhir/R4/validation.html, and to the R5 page in the R5 guide.
Document the collision in the README as well. This was the only Jekyll
expression in a template, but the publisher offers a dozen data files behind
site.data, and nothing reports the mistake: the page renders, the link is
just wrong.
The variable table listed five of the entries in context-R4.json and
context-R5.json and left out eu-core-r-code, the -yaml markers and the one
whose key ends in a space. The last two are the ones that need explaining:
{{R }} renders as nothing and holds the marker column for lines that belong
to both versions, and {{R4-yaml}} / {{R5-yaml}} are the comment markers for
files in which // does not start a comment.
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.
Fixes the broken link reported by QA, e.g. on
the xtehr-1.0 preview:
Not specific to that branch — a build of
masterreproduces it.Cause
Two Liquid engines run over the same file.
downloads.liquid.mdis a template, so thepreprocessing renders it before Jekyll ever sees it, and both use
{{ }}. liquidjsresolves
site.data.fhir.pathagainstcontext-<Rx>.json, which has nositevariable,so it becomes the empty string:
What should have been
http://hl7.org/fhir/R4/validation.htmlturned into a relative linkto a page the guide does not have.
site.data.fhir.pathcomes fromtemp/pages/_data/fhir.json,which the publisher writes before running Jekyll — it holds
http://hl7.org/fhir/R4/in theR4 build and the R5 URL in the R5 build, which is precisely why it should not be replaced
by a hardcoded URL.
Change
{% raw %}hands the expression through the first pass. liquidjs consumes the tag andemits its content verbatim, so Jekyll receives a plain expression and resolves it as usual.
Renaming the file to
downloads.mdwould also work, but it needs Liquid for its{% if isR4 %}/{% if isR5 %}blocks.The README gains a short subsection on the collision. This was the only Jekyll
expression in a template — I checked every
.liquid.file forsite.,page.,include.and
{% include %}— but the publisher offers a dozen data files behindsite.data.*, andnothing reports the mistake: the page still renders, the link is just wrong.
Verification
Full R4 publisher build, before and after:
hrefindownloads.htmlvalidation.htmlhttp://hl7.org/fhir/R4/validation.htmlvalidation.htmlno longer appears inqa.txt. Both targets exist (http://hl7.org/fhir/R4/validation.htmland the R5 one return 200), and the expression is preserved in the generated
downloads.mdof both FHIR versions.
The remaining
Errors: 1is a separate, pre-existing content finding and is untouched here.