eecs485staff / primer-spec

A Jekyll theme for sites with content-heavy pages
https://eecs485staff.github.io/primer-spec/
MIT License
22 stars 12 forks source link

Sidebar links broken in preview #216

Closed awdeorio closed 1 year ago

awdeorio commented 1 year ago

Describe the bug The links in the sidebar are broke in the GH-Actions-created preview

To Reproduce

  1. Create PR and see the Generate spec preview GH Action run (example)
  2. Navigate to the preview
  3. Click on something in the side bar

You'll see a broken link, e.g., https://preview.sesh.rs/previews/eecs485staff/p3-insta485-clientside/626/pages/eecs485staff/p3-insta485-clientside/setup_react.html

Expected behavior Link should be something like https://preview.sesh.rs/previews/eecs485staff/p3-insta485-clientside/626/setup_react.html

seshrs commented 1 year ago

Very weird bug! My guess is that this is happening only now because GitHub Pages deployments have moved to GitHub Actions. But I'm going to need to debug this further.

noah-weingarden commented 1 year ago

Unfortunately, the sidebar tutorial links are currently broken as described in this issue for the production build of project 4.

seshrs commented 1 year ago

😱 oof, thanks for raising! I'm looking into this now.

seshrs commented 1 year ago

I quickly suspected that the issue was related to the baseurl property, but it took me several embarrassing commits to properly fix seshrs/build-primer-spec-action 😅

If you're curious, this is the fix: https://github.com/seshrs/build-primer-spec-action/blob/e04cb027b517ccf0aa6ea99397d73375169cf6c0/action.yml#L16-L33

And if you're curious what baseurl does in Jekyll, here's a TLDR:

https://eecs485staff.github.io/p4-mapreduce/heapq.html
                                           ^^^^^^^^^^^ path
                              ^^^^^^^^^^^^^ baseurl (was being set to 'pages' by default for some reason)
^^^^^^^^^^^^ url ^^^^^^^^^^^^^

(Further reading: https://mademistakes.com/mastering-jekyll/site-url-baseurl/)


I took the liberty of re-running the deploy job (attempt 2) for the P4 website. The links in the Sidebar now work!

noah-weingarden commented 1 year ago

Huh, that isn't very well-documented in GitHub Pages/Jekyll, is it? Thanks Sesh!