File tree Expand file tree Collapse file tree 6 files changed +33
-18
lines changed Expand file tree Collapse file tree 6 files changed +33
-18
lines changed File renamed without changes.
Original file line number Diff line number Diff line change @@ -1407,4 +1407,10 @@ div.alert > em.javascript-required {
1407
1407
cursor : pointer ;
1408
1408
font-size : calc (5vw + 10px );
1409
1409
color : #333 ;
1410
+ }
1411
+
1412
+ .code-sample > .copy-code-icon {
1413
+ cursor : pointer ;
1414
+ text-align : right ;
1415
+ padding : 0.2rem ;
1410
1416
}
Original file line number Diff line number Diff line change @@ -68,6 +68,9 @@ other = "YouTube"
68
68
[conjunction_1 ]
69
69
other = " and"
70
70
71
+ [copy_sample_to_clipboard ]
72
+ other = " Copy {{ .filename }} to clipboard"
73
+
71
74
[cve_id ]
72
75
other = " CVE ID"
73
76
Original file line number Diff line number Diff line change 1
1
{{ $p := .Page }}
2
2
{{ $file := .Get "file" }}
3
- {{ $codelang := .Get "language" | default (path.Ext $file | strings.TrimPrefix ".") }}
3
+ {{ $codelang := .Get "language" | default (path.Ext $file | strings.TrimPrefix ".") }}
4
4
{{ $fileDir := path.Split $file }}
5
5
{{ $bundlePath := path.Join .Page.File.Dir $fileDir.Dir }}
6
6
{{ $filename := printf "/content/%s/examples/%s" .Page.Lang $file | safeURL }}
18
18
{{ errorf "[%s] %q not found in %q" site.Language.Lang $fileDir.File $bundlePath }}
19
19
{{ end }}
20
20
{{ with $.Scratch.Get "content" }}
21
- < div class ="highlight ">
22
- < div class ="copy-code-icon " style =" text-align:right " >
21
+ < div class ="highlight code-sample ">
22
+ < div class ="copy-code-icon ">
23
23
{{ with $ghlink }}< a href ="{{ . }} " download ="{{ $file }} "> {{ end }}< code > {{ $file }}</ code >
24
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 >
25
+ {{- $copyTitle := T "copy_sample_to_clipboard" (dict "filename" $file) -}}
26
+ {{- with resources.Get "images/copycode.svg" -}}
27
+ < img src ="{{ .RelPermalink }} " class ="icon-copycode " onclick ="copyCode('{{ $file | anchorize }}') " title ="{{ $copyTitle }} "> </ img >
28
+ {{- end -}}
27
29
</ div >
28
30
< div class ="includecode " id ="{{ $file | anchorize }} ">
29
31
{{- highlight . $codelang "" -}}
30
32
</ div >
31
33
</ div >
32
- {{ end }}
34
+ {{- end - }}
Original file line number Diff line number Diff line change 1
1
{{ $p := .Page }}
2
2
{{ $file := .Get "file" }}
3
- {{ $codelang := .Get "language" | default (path.Ext $file | strings.TrimPrefix ".") }}
3
+ {{ $codelang := .Get "language" | default (path.Ext $file | strings.TrimPrefix ".") }}
4
4
{{ $fileDir := path.Split $file }}
5
5
{{ $bundlePath := path.Join .Page.File.Dir $fileDir.Dir }}
6
6
{{ $filename := printf "/content/%s/examples/%s" .Page.Lang $file | safeURL }}
18
18
{{ errorf "[%s] %q not found in %q" site.Language.Lang $fileDir.File $bundlePath }}
19
19
{{ end }}
20
20
{{ with $.Scratch.Get "content" }}
21
- < div class ="highlight ">
22
- < div class ="copy-code-icon " style =" text-align:right " >
21
+ < div class ="highlight code-sample ">
22
+ < div class ="copy-code-icon ">
23
23
{{ with $ghlink }}< a href ="{{ . }} " download ="{{ $file }} "> {{ end }}< code > {{ $file }}</ code >
24
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 >
25
+ {{- $copyTitle := T "copy_sample_to_clipboard" (dict "filename" $file) -}}
26
+ {{- with resources.Get "images/copycode.svg" -}}
27
+ < img src ="{{ .RelPermalink }} " class ="icon-copycode " onclick ="copyCode('{{ $file | anchorize }}') " title ="{{ $copyTitle }} "> </ img >
28
+ {{- end -}}
27
29
</ div >
28
30
< div class ="includecode " id ="{{ $file | anchorize }} ">
29
31
{{- highlight . $codelang "" -}}
30
32
</ div >
31
33
</ div >
32
- {{ end }}
34
+ {{- end - }}
Original file line number Diff line number Diff line change 1
1
{{ $p := .Page }}
2
2
{{ $file := .Get "file" }}
3
- {{ $codelang := .Get "language" | default (path.Ext $file | strings.TrimPrefix ".") }}
3
+ {{ $codelang := .Get "language" | default (path.Ext $file | strings.TrimPrefix ".") }}
4
4
{{ $fileDir := path.Split $file }}
5
5
{{ $bundlePath := path.Join .Page.File.Dir $fileDir.Dir }}
6
6
{{ $filename := printf "/content/%s/examples/%s" .Page.Lang $file | safeURL }}
18
18
{{ errorf "[%s] %q not found in %q" site.Language.Lang $fileDir.File $bundlePath }}
19
19
{{ end }}
20
20
{{ with $.Scratch.Get "content" }}
21
- < div class ="highlight ">
22
- < div class ="copy-code-icon " style =" text-align:right " >
21
+ < div class ="highlight code-sample ">
22
+ < div class ="copy-code-icon ">
23
23
{{ with $ghlink }}< a href ="{{ . }} " download ="{{ $file }} "> {{ end }}< code > {{ $file }}</ code >
24
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 >
25
+ {{- $copyTitle := T "copy_sample_to_clipboard" (dict "filename" $file) -}}
26
+ {{- with resources.Get "images/copycode.svg" -}}
27
+ < img src ="{{ .RelPermalink }} " class ="icon-copycode " onclick ="copyCode('{{ $file | anchorize }}') " title ="{{ $copyTitle }} "> </ img >
28
+ {{- end -}}
27
29
</ div >
28
30
< div class ="includecode " id ="{{ $file | anchorize }} ">
29
31
{{- highlight . $codelang "" -}}
30
32
</ div >
31
33
</ div >
32
- {{ end }}
34
+ {{- end - }}
You can’t perform that action at this time.
0 commit comments