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

Missing dependencies and broken links when using GH Pages #478

Open
jordanperr opened this issue Dec 4, 2020 · 3 comments
Open

Missing dependencies and broken links when using GH Pages #478

jordanperr opened this issue Dec 4, 2020 · 3 comments

Comments

@jordanperr
Copy link

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 jordanperr changed the title Missing dependencies and broken links on own Github pages Missing dependencies and broken links when using GH Pages Dec 5, 2020
@LRWeber
Copy link
Member

LRWeber commented Dec 7, 2020

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?

@IanLee1521
Copy link
Member

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"

@jordanperr
Copy link
Author

I updated this configuration to no effect. Some quick debugging reveals some hard-coded absolute paths in index.html:

<script src="/js/app.js"></script>

After removing the first slash in those paths the site loads, but many of the nav links are broken (also pointing to absolute paths).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants