mirror of
https://github.com/gohugoio/hugoDocs.git
synced 2025-10-04 15:13:27 -04:00
20 lines
939 B
HTML
20 lines
939 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 "{{.}}".">
|
|
<i class="icon-download"></i>
|
|
</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><!-- <div class="copy-text"> COPY</div> -->
|
|
</button>
|
|
{{end}}
|
|
<div class="code-copy-content" {{with .Get "download"}}id="{{.}}"{{end}}>
|
|
{{- .Inner -}}
|
|
</div>
|
|
</div> |