20

I am trying to render my GitHub repo on the Publisher-Subscriber module with JavaScript using GitHub pages. The gh-pages branch looks fine. However, the mustache code does not render on my project on GitHub Pages. It looks like this :

enter image description here

GitHub Repository : https://github.com/ajhalthor/pubsub-application

Github Pages Repo for this project : https://ajhalthor.github.io/pubsub-application/

The GitHub Repository also has the node_modules folder, so it should be self sufficient. Mustache, jQuery & Bootstrap are included in this folder, so there are no external links or CDNs.

Main Question : Why isn't mustache rendering even though all paths are specified relative to the project's main folder?

4
  • ajhalthor.github.io/pubsub-application/node_modules/mustache/… should give you a hint. Commented Apr 19, 2017 at 5:59
  • better yet use rawgit. Commented Apr 19, 2017 at 6:01
  • To your first comment: It seems like the node_modules folder is not found. But it is a part of my repository. So why isn't this found ? Commented Apr 19, 2017 at 6:10
  • Added an answer. Commented Apr 19, 2017 at 6:22

1 Answer 1

40

Github pages uses a version of Jekyll that ignores node_modules folder by default.

According to this blog article. You can do the following:

Create an empty .nojekyll text file in the root of the gh-pages branch.

You can also refer to this announcement by github which talks about the update that is responsible for this behavior.

Sign up to request clarification or add additional context in comments.

3 Comments

Thanks! This worked for me. I also tried rawgit and that gave me a url for development & production. According to you, how is that better?
It isn't better, but its an option.
Thanks for the heads up mate

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.