Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions layouts/shortcodes/ghcode.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,24 @@
{{ with try (resources.GetRemote $file) }}
{{ with .Err }}
{{ errorf "%s" . }}
{{ else }}
{{ else with .Value }}
{{ $lang := path.Ext $file | strings.TrimPrefix "." }}
<div id="code-block-v1" data-mf="false">
{{ highlight .Value $lang $params }}
{{ highlight .Content $lang $params }}
</div>

<div class="code-block" data-mf="true" style="display: none;">
{{- if and (ne $lang "") (ne $lang "none") -}}
<span class="code-type chroma">{{ $lang }}</span>
{{- end -}}
<div class="code-container chroma">
<button onclick="copyToClipBoard(this, {{ $codeBlockId }})" class="code-copy-button multi-line" type="button">Copy</button>
<div class="highlight-v2" id="{{ $codeBlockId }}">
{{ highlight .Value $lang $params }}
{{ highlight .Content $lang $params }}
</div>
</div>
</div>
{{ end }}
{{ else }}
{{ errorf "Unable to load github content from %s from %q" $file .Position}}
{{ end }}
{{ end }}
Loading