Search code examples
github-pagesjekyll-theme

github pages remote theme not working


I have created a repository level github page in the root directory of my project. This works fine, and after a small build interval, the index.html page is served as expected at https://erikor.github.io/myrepo/

Now I am trying to use the dyutibarma/monochrome theme.

Per this post, I, somewhat naively, thought that all I needed to do was to put this in my _config.yml:

remote_theme: dyutibarma/monochrome

But the resulting page clearly expects some theme related resources to be in my repo, not the remote theme repo. For example:

<link rel="stylesheet" href="/myrepo/css/main.css">

And thus, my page is not styled properly.

Is there a way to point github pages to the remote theme resources, or is the only way to accomplish this to fork the theme, build it, and then add my content? I was hoping to avoid that every time I want to switch themes if possible, particularly after reading the above referenced post about remote themes.

Thanks in advance, Eric


Solution

  • The dyutibarma/monochrome theme is not jekyll-remote-theme compatible. For example: it has the "css", "img", "js" folder in it's root directory. Those folders will not be deployed when used via remote_theme. They must be moved within an assets folder in order to be deployed. I just created a PR for an other theme to be jekyll-remote-theme compatible and published a working demo on github.

    Never fork a theme! A GitHub fork can not be changed later. So when you want to change the theme later on the fork will always point on your first theme. When the theme is not jekyll-remote-theme compatible just clone it and push it as a self-standing repository. Add the theme base repository as upstream to fetch bugfixes and new features. I have written a blog post about this.

    BR