Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Formating on index page is off #1360

Open
kommendorkapten opened this issue Sep 4, 2024 · 4 comments
Open

Formating on index page is off #1360

kommendorkapten opened this issue Sep 4, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@kommendorkapten
Copy link
Member

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

@kommendorkapten kommendorkapten added the bug Something isn't working label Sep 4, 2024
@jku
Copy link
Member

jku commented Sep 4, 2024

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

@jku
Copy link
Member

jku commented Sep 4, 2024

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

@jku
Copy link
Member

jku commented Sep 4, 2024

... 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

@jku
Copy link
Member

jku commented Sep 5, 2024

I'm moving this to theupdateframework/tuf-on-ci#430

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants