Skip to content

Proposal: Move linkset.json to resources #7

Description

@achim-w

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions