Skip to content

Commit 245f989

Browse files
committed
fix copy clipboard
1 parent 3f8a10f commit 245f989

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

layouts/shortcodes/codenew.html

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,14 @@
1919
{{ end }}
2020
{{ with $.Scratch.Get "content" }}
2121
<div class="highlight">
22-
<div class="includecode" style="text-align: right" id="{{- $file | anchorize -}}">
23-
{{- with $ghlink -}}<a href="{{ . }}" download="{{ $file }}">{{- end -}}
24-
<code>{{ $file }}</code>
25-
{{ if $ghlink }}</a>{{ end }}<img src="{{ "images/copycode.svg" | relURL }}" style="max-height:24px; cursor: pointer" onclick="copyCode('{{ $file | anchorize }}')" title="Copy {{ $file }} to clipboard">
22+
<div class="copy-code-icon" style="text-align:right">
23+
{{ with $ghlink }}<a href="{{ . }}" download="{{ $file }}">{{ end }}<code>{{ $file }}</code>
24+
{{ if $ghlink }}</a>{{ end }}
25+
<img src="{{ "images/copycode.svg" | relURL }}" style="max-height:24px; cursor: pointer" onclick="copyCode('{{ $file | anchorize }}')" title="Copy {{ $file }} to clipboard">
26+
</img>
27+
</div>
28+
<div class="includecode" id="{{ $file | anchorize }}">
29+
{{ highlight . $codelang "" }}
2630
</div>
27-
{{ highlight . $codelang "" }}
2831
</div>
29-
{{- end -}}
32+
{{ end }}

0 commit comments

Comments
 (0)