tufu9441 / maupassant-hexo

A simple Hexo theme forked from icylogic.
https://www.haomwei.com
MIT License
2.64k stars 668 forks source link

如何使用google-code-prettify替换默认的highlight #469

Closed ankexun closed 3 years ago

ankexun commented 4 years ago

默认的highlight代码高亮不够美观,怎么替换成google-code-prettify.

主要是对.pug这个模版不熟悉,不知道在after_footer.pug里写这段代码:

<script type="text/javascript">
$(document).ready(function(){
 $('pre').addClass('prettyprint linenums');
 $('code').addClass('prettyprint');
 prettyPrint();
 })
</script>
tufu9441 commented 3 years ago

脚本写法没有很大区别,可以试试:

script(type='text/javascript').
  $(document).ready(function(){
  $('pre').addClass('prettyprint linenums');
  $('code').addClass('prettyprint');
  prettyPrint();
 })