Blog 1

Random Talk on Random Thoughts

Custom JavaScripts in the Head of Octopress Pages

| Comments |

When I set up Blog 1 for MathJax and fancybox, I included some custom code in source/_includes/custom/head.html. I moved them to source/javascripts/MathJaxLocal.js and source/javascripts/FancyBoxLocal.js because I don’t like JavaScript code inside HTML files.1

In the past, I put those code in source/_includes/custom/head.html because of Felix Chern’s post.2 However, there’s another better way.3 Why is it better? It saves thousands of lines of code. Apart from that, it’s a way to separate the behaviour of a document from the contents.4

git-diff --stat