Selectively load hljs languages

This commit is contained in:
Rico Sta. Cruz 2015-04-17 00:48:22 +08:00
parent 8ff83e3797
commit 84785bba76
3 changed files with 8 additions and 3 deletions

View File

@ -1,8 +1,11 @@
{% include about-the-site.html %}
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.5/highlight.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.5/languages/vim.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.5/languages/haml.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.5/languages/scss.min.js"></script>
{% comment %}<!-- https://github.com/highlightjs/cdn-release/tree/master/build/languages -->{% endcomment %}
{% for lang in page.hljs_languages %}
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.5/languages/{{lang}}.min.js"></script>
{% endfor %}
<script src="http://cdn.rawgit.com/rstacruz/unorphan/v1.0.1/index.js"></script>
<script>hljs.initHighlightingOnLoad()</script>
<script>unorphan('h1, h2, h3, p, li, .unorphan')</script>

View File

@ -1,6 +1,7 @@
---
title: Rails form helpers
layout: default
hljs_languages: [haml]
---
## Form builder

View File

@ -1,5 +1,6 @@
---
title: Vim script
hljs_languages: [vim]
---
```vim