Formating on index page is off
Opened this issue · 4 comments
Description
Looking at:
https://sigstore.github.io/root-signing/index.html
vs
https://tuf-repo-cdn.sigstore.dev/index.html
There is a visual difference. Inspecting the page shows an error, 404 when getting style.css
Version
Deployed as of 2024-09-04
yeah, this happens in staging too. If you have ideas for reliably making the styling work, please add that into a tuf-on-ci issue
oh forgot to mention the actual issue here:
- tuf-on-ci produces the index.md, the html is produced from markdown by jekyll
- jekyll really, really likes using absolute URLs so the css URL is
/root-signing/assets/css/style.css?v=a4b685e8705fdb5078638a18dbea969788c0036d
I don't see a lot of clean and easy ways to make the URL work when the repo is moved to e.g GCS ...
- The proper fix is likely to not use markdown and produce the html in tuf-on-ci directly somehow -- I do not have the skills for this
- maybe you can coerce jekyll to use relative urls or somehow hack the html when publishing but I fee like these will end up being real hacks
... hack the html when publishing but I fee like these will end up being real hacks
specifically I suppose we could add a step in upload-repository action that runs after actions/jekyll-build-pages has executed, and modifies the html swapping the absolute path with a relative one.
EDIT: I had a quick look and it's as ugly as I expected:
- index.html is generated in metadata dir
- assets are in $jekyllroot/assets/ - this might be metadata dir but might not
It's annoying to figure out the relative path from metadata dir to the assets dir: it could be "assets/" but it could be "../assets/" just as well. Not impossible but exactly the sort of thing I dislike putting in a workflow bash script...
# jekyll really likes absolute links, which breaks the styles if the repository is moved
# jekyll-build-pages also creates the files as root...
# TODO define RELPATH based on inputs.metadata_path depth (./ or .../ or ../../ etc)
sudo sed -i "s#href=\"/.*/assets/css/style.css#href=\"$RELPATH/assets/css/style.css#" build-jekyll/${{inputs.metadata_path}}/index.html
I'm moving this to theupdateframework/tuf-on-ci#430