Currently, linkset.json is saved in the main directory. The URL to the linkset.json file is injected during the GitHub actions/GitLab CI pipeline based on the URL of the repository and the current branch/tag into mkdocs.yml:
|
linkset_path="https://raw.githubusercontent.com/$GITHUB_REPOSITORY/$GITHUB_REF_NAME/linkset.json" |
|
echo "LINKSET_URL=$linkset_path" >> $GITHUB_ENV |
|
yq eval -i '.signposting_linkset="${{ env.LINKSET_URL }}"' mkdocs.yml |
From there, the template picks up this variable:
|
<link rel="linkset" type="application/json+linkset" href="{{ config.signposting_linkset }}" > |
Wouldn't it be easier to save the file under resources/linkset.json? The command mike deploy would then automatically push this file to the root directory of the pages site. Then, the dynamic creation of the URL is no longer necessary as the file could be referenced with ./linkset.json in the template.
This would make the pipeline easier, as the code can be removed, and linkset.json would be stored more closely to the other files of the rendered page.
Currently,
linkset.jsonis saved in the main directory. The URL to thelinkset.jsonfile is injected during the GitHub actions/GitLab CI pipeline based on the URL of the repository and the current branch/tag intomkdocs.yml:templates/.github/workflows/signposting.yml
Lines 29 to 30 in 83f29bc
templates/.github/workflows/signposting.yml
Line 43 in 83f29bc
From there, the template picks up this variable:
templates/resources/overrides/signposting.html
Line 39 in 83f29bc
Wouldn't it be easier to save the file under
resources/linkset.json? The commandmike deploywould then automatically push this file to the root directory of the pages site. Then, the dynamic creation of the URL is no longer necessary as the file could be referenced with./linkset.jsonin the template.This would make the pipeline easier, as the code can be removed, and
linkset.jsonwould be stored more closely to the other files of the rendered page.