diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2017-07-21 11:00:08 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2017-07-21 11:00:08 +0200 |
commit | f387cb1b38fe8b09e4cbca9816caaa840de55c5b (patch) | |
tree | 55788e9ac44fc6833a35732a1a273f26a0d2811a /docs/layouts | |
parent | 40566ec98e23b93f538a50bc51f5c46d8e5056bc (diff) | |
parent | 2c0d1ccdcd95de0bddeb39dca2e4d08f0d8056d7 (diff) |
doc: Merge commit '2c0d1ccdcd95de0bddeb39dca2e4d08f0d8056d7'
Diffstat (limited to 'docs/layouts')
-rw-r--r-- | docs/layouts/shortcodes/code.html | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/docs/layouts/shortcodes/code.html b/docs/layouts/shortcodes/code.html index 6df49956a..009aeb711 100644 --- a/docs/layouts/shortcodes/code.html +++ b/docs/layouts/shortcodes/code.html @@ -1,5 +1,7 @@ -<div class="code relative bg-primary-color moon-gray" id="{{.Get "file" | urlize}}"> - {{- with .Get "file" -}} +{{ $file := .Get "file" }} +{{ $isHTML := strings.HasSuffix $file "html" }} +<div class="code relative bg-primary-color" id="{{ $file | urlize}}"> + {{- with $file -}} <div class="filename san-serif f6 dib lh-solid pl2 pv2">{{.}}</div> {{- end -}} @@ -9,7 +11,7 @@ {{/* Functionality located within filesaver.js The copy here is located in the css with .copy class so it can be replaced with JS on success */}} {{end}} <div class="code-copy-content nt3" {{with .Get "download"}}id="{{.}}"{{end}}> - {{- .Inner -}} + {{ if $isHTML }}{{- highlight .Inner "html" "" | -}}{{ else }}<pre><code>{{- .Inner | string -}}</code></pre>{{ end }} </div> </div> |