mirror of
https://github.com/gohugoio/hugo.git
synced 2026-09-03 04:02:38 +00:00
21 lines
727 B
HTML
21 lines
727 B
HTML
{{$icon := index (split (.Get "file") ".") 1 }}
|
|
<div class="code" id="{{.Get "file" | urlize}}">
|
|
{{- with .Get "file" -}}
|
|
<div class="code-icon">
|
|
<i class="icon-{{$icon}} input"></i>
|
|
</div>
|
|
{{- end -}}
|
|
{{with .Get "download"}}
|
|
<button class="download-button" title="Download "{{.}}".">
|
|
<i class="icon-download"></i><span class="button-text">Download</span>
|
|
</button>
|
|
{{end}}
|
|
{{ if ne (.Get "copy") "false" }}
|
|
<button class="copy-button" title="Copy this code to your clipboard." data-clipboard-snippet>
|
|
<i class="icon-clipboard"></i><span class="button-text"> Copy</span>
|
|
</button>
|
|
{{end}}
|
|
<div class="code-copy-content" {{with .Get "download"}}id="{{.}}"{{end}}>
|
|
{{- .Inner -}}
|
|
</div>
|
|
</div> |