许多hexo文件都是使用jade来进行书写的,因此,在这里简单介绍一下如何在jade中插入javascript,使其正确的渲染。 // refer: http://stackoverflow.com/questions/5858218/how-can-i-render-inline-javascript-with-jade 在主题中找到layout.jade这种类似的,每一个静态页面渲染都需要的jade文件,加入google-analytics的代码即可。记得删除google analytics中所带的<script>标签,使用script.来代替它。 例如: // <script> script. (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), ... // </script> ……

Continue reading