llnl.github.io icon indicating copy to clipboard operation
llnl.github.io copied to clipboard

Missing dependencies and broken links when using GH Pages

Open jordanperr opened this issue 5 years ago • 3 comments

I am able to serve this project locally using bundle exec jekyll serve and navigate around the UI. Unfortunately, this does not seem to work through Github Pages. There appear to be several assets (css and js files) hosted separately on software.llnl.gov which are not available to github pages.

Steps to reproduce:

  1. Fork llnl.github.io into own account.
  2. Rebuild data index using MASTER.sh script
  3. Delete CNAME file
  4. Enable github pages pointing to "master"
  5. Navigate to github pages url (in my case, https://jordanperr.github.io/llnl.github.io/)

Expected Behavior: Site should appear as it does locally. Observed Behavior: UI is broken, many assets not loaded (404 errors in developer console).

jordanperr avatar Dec 04 '20 22:12 jordanperr

It looks like there's a difference in the expected URL. For a file like main.css, the page is trying to load https://jordanperr.github.io/css/main.css, but for it to work it should be https://jordanperr.github.io/llnl.github.io/css/main.css

@IanLee1521 do you know if there's a way to configure the site to use a non-base-URL path as the root like that?

LRWeber avatar Dec 07 '20 17:12 LRWeber

I think you use the url field in the _config.yml file, see: https://github.com/LLNL/llnl.github.io/blob/main/_config.yml#L7

Or you use baseurl (https://jekyllrb.com/docs/configuration/default/) which I think would be (in this case) baseurl: "/llnl.github.io"

IanLee1521 avatar Dec 07 '20 17:12 IanLee1521

I updated this configuration to no effect. Some quick debugging reveals some hard-coded absolute paths in index.html: https://github.com/LLNL/llnl.github.io/blob/3b058036a5f9d0f3c0a7b0d110e32314a75b340a/index.html#L50 After removing the first slash in those paths the site loads, but many of the nav links are broken (also pointing to absolute paths).

jordanperr avatar Dec 09 '20 17:12 jordanperr