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 has wrong URLs in PR previews #247

Closed noah-weingarden closed 1 year ago

noah-weingarden commented 1 year ago

Describe the bug In PR previews, the URLs in the sidebar are incorrect, leading to 404 errors.

To Reproduce Steps to reproduce the behavior:

  1. Go to https://preview.sesh.rs/previews/eecs485staff/p5-search-engine/645/
  2. Click on "Python Async IO Tutorial" in the sidebar.
  3. It links to https://preview.sesh.rs/previews/eecs485staff/p5-search-engine/645/pages/eecs485staff/p5-search-engine/async-tutorial.html.

Expected behavior It should instead link to https://preview.sesh.rs/previews/eecs485staff/p5-search-engine/645/async-tutorial.html.

I know this is a duplicate of #216, but it seems that it's not completely resolved. Now at least this issue definitely doesn't affect production builds--only PR previews.

seshrs commented 1 year ago

Ugh... I think it's because we don't specify a baseurl and GitHub/Jekyll uses some unhelpful default. The longer-term fix requires the creation of another action just for spec previews on GitHub

Thankfully, there is a short-term fix: I'll just update my preview server to redirect links starting with path /pages/ 😆

(This is also a good reminder that I need to rewrite the Primer Spec Preview server. While Ruby is magical, I'm not familiar enough with it to set up a great local testing environment...)