4
votes

Whilst using Github Pages I can't get Jekyll to render a contact page. I am using the following template: https://github.com/antonostrovsky/tale

If I clone the template into a local repo and run bundle exec jekyll serve I get a page with a Contact link that I can successfully follow. The generated _site folder contains a subfolder 'contact' with index.html within it.

I then create an empty repository (https://github.com/antonostrovsky/test_site) at Github and specify this template in _config.yml:

remote_theme: antonostrovsky/tale

The template is successfully rendered, I can see the template on the index page (https://antonostrovsky.github.io/test_site/), and the Contact link leads to nowhere, resulting in "Not Found" error.

  1. Can anyone please help me understand how I can troubleshoot this? Does Jekyll have any debug output that could be placed on a github page?
  2. Does anyone know what could be going wrong?

Thank you in advance

2
I think your repo is missing a Gemfile according to github.com/antonostrovsky/tale#github-pages-method - midzer
@midzer thank you for having a look. Could you please explain what you mean? The Gemfile is present in the theme repository. - Tony Sepia
Your local development repository needs to fetch those (Gemfile) dependencies via bundle. I am not sure whether you should point to the original theme (remote_theme: chesterhow/tale) incase you have not modified it. - midzer
@midzer, thank you. I have opened the local repository, ensured that the Gemfile exists and ran "bundle" command. Then pushed the changes to remote repository hosting the theme. I have then pointed my website via remote_theme to my theme. And it works, apart from the Contact link. - Tony Sepia

2 Answers

1
votes

I made a diff between your repo and the template repo and noticed that at some stage you deleted the baseurl property in the _config.yml file.

Forking your repo and re-adding baseurl: "/tale" to the _config.yml file fixes the contact page link for me.

UPDATE:

While the above gets the page working as a fork it doesn't work as a remote template which is what the asker needs.

The test_site has the theme and it builds, however it has no content. There are no pages in test_site repo.

If you copy your contact.md page from the theme template repo into pages/contact.md in the test site repo and then rebuild then your link should now work.

Note: Neither the file nor folder can start with an _ in the test-site repo because it will get skipped over by jekyll.

Tip: Open the dev console and disable page caching then reload to see your changes on github faster. It also helps to add change some page content so that you know you're seeing the most recent version.

1
votes

To add to the accepted answer and explain this strange behaviour. Pages from the remote theme are NOT included by design:

Custom theme files can be placed in:

assets/allposts.html

with the front matter

---
permalink: allposts.html
---

which results in the

 _site/allposts.html

file being generated.

Source: https://github.com/benbalter/jekyll-remote-theme/issues/64