问题
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 :
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?
回答1:
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.
来源:https://stackoverflow.com/questions/43481269/github-pages-404-on-node-modules-folder