diff options
-rw-r--r-- | exampleSite/config.yml | 3 | ||||
-rw-r--r-- | layouts/partials/script.html | 6 |
2 files changed, 6 insertions, 3 deletions
diff --git a/exampleSite/config.yml b/exampleSite/config.yml index 05f932f..8ec2ba8 100644 --- a/exampleSite/config.yml +++ b/exampleSite/config.yml @@ -71,6 +71,9 @@ params: # Enable/Disable menu icons # Icon Reference: http://blog.cofess.com/hexo-theme-pure/iconfont/demo_fontclass.html enableMathJax: true #Enable mathjax support, to use mathematical notations + highlightjs: + langs: ["python", "javascript"] #specify languages for which you want to add syntax highlight support + menuIcons: enable: true # 是否启用导航菜单图标 home: icon-home-fill diff --git a/layouts/partials/script.html b/layouts/partials/script.html index b18a56c..9ff925c 100644 --- a/layouts/partials/script.html +++ b/layouts/partials/script.html @@ -6,9 +6,9 @@ window.jQuery || document.write('<script src="js/jquery.min.js"><\/script>') </script> <script type="text/javascript" src="https://cdn.staticfile.org/highlight.js/9.15.10/highlight.min.js"></script> -<script type="text/javascript" src="https://cdn.staticfile.org/highlight.js/9.15.10/languages/rust.min.js"></script> -<script type="text/javascript" - src="https://cdn.staticfile.org/highlight.js/9.15.10/languages/dockerfile.min.js"></script> +{{- range .Site.Params.highlightjs.langs }} +<script type="text/javascript" src="https://cdn.staticfile.org/highlight.js/9.15.10/languages/{{.}}.min.js"></script> +{{- end -}} <script> hljs.configure({ tabReplace: ' ', // 4 spaces |