Fixed: Collection pages not working on GH Pages - was fine locally

Hi all,

I feel like I’m so close to an answer but I just can’t figure it out.

I made my site all locally with Jekyll and yesterday got it up on Github Pages.

Locally, I had commented out my baseurl in the _config and the site worked just fine off of :4000.

Now that it’s up on Pages I uncommented the baseurl. I also added a url field. I run my personal website through pages as well.

My index works fine, styles intact and everything. However, my two subpages (which are both from the same ‘collection’) aren’t working.

The repository is here: https://github.com/BradCoffield/APIs-for-librarians
The actual site is here: http://www.bradcoffield.com/APIs-for-librarians/ and the links that aren’t working are at the bottom of the landing page.

I really appreciate any help you can provide. Thanks.

UPDATE:

Still not fixed but I’ve figured more of the problem:
When clicking on a link it goes to www.bradcoffield.com/collection_name/file_name
When I changed that to www.bradcoffield.com/repo_name/collection_name/file_name it works…

UPDATE FIXED:

My link was malformed on the index.html - I had {{collection_name.url}} and needed {{site.baseurl}}{{collection_name.url}}

to avoid future breakage, always use the built-in filter(s)

{{ collection_name.url | relative_url }}

and

{{ collection_name.url | absolute_url }}

Both filters automatically use the configured baseurl value to output a proper link.
The absolute_url additionally uses the configured url value to output a full url for the resource.

A

1 Like

Thanks for telling me. I didn’t know about those!

1 Like