Files
hugo/layouts/shortcodes/code.html
T

20 lines
920 B
HTML

{{$icon := index (split (.Get "file") ".") 1 }}
<div class="code-copy input" id="{{.Get "file" | urlize}}">
{{- with .Get "file" -}}<div class="code-copy-header"><div class="action-buttons"></div><span title="{{.}}" class="filename">{{- . -}}</span><i class="icon-{{$icon}} input"></i></div>{{- end -}}
{{with .Get "source"}}
<a href="{{.}}" class="see-code-source" role="button" target="_blank" title="See source for this snippet">See Source</a>
{{end}}
{{with .Get "download"}}
<button class="download-button" title="Download a copy of {{.}}">
<i class="icon-download"></i>
</button>
{{end}}
{{ if ne (.Get "copy") "false" }}
<button class="copy-button" title="Copy to clipboard" data-clipboard-snippet>
<i class="icon-clipboard"></i><!-- <div class="copy-text"> COPY</div> -->
</button>
{{end}}
<div class="code-copy-content" {{with .Get "download"}}id="{{.}}"{{end}}>
{{- .Inner -}}
</div>
</div>