Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/CaiJimmy/hugo-theme-stack.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJimmy Cai <github@jimmycai.com>2022-06-12 17:26:20 +0300
committerGitHub <noreply@github.com>2022-06-12 17:26:20 +0300
commitd89def07acfa3df3264e831b999e145ca6321a84 (patch)
tree33f5e65c7954430d02951ea54258d8b69d5447fa
parent7a710cbb55d1130e1ea145dce56dcc714a2d9265 (diff)
feat: i18n support for codeblock copy text
-rw-r--r--i18n/en.yaml3
-rw-r--r--layouts/_default/_markup/render-codeblock.html4
2 files changed, 5 insertions, 2 deletions
diff --git a/i18n/en.yaml b/i18n/en.yaml
index 32223f1..3f94ab1 100644
--- a/i18n/en.yaml
+++ b/i18n/en.yaml
@@ -19,6 +19,9 @@ article:
readingTime:
one: "{{ .Count }} minute read"
other: "{{ .Count }} minute read"
+ codeblock:
+ copy: Copy
+ copied: Copied!
notFound:
title: Not Found
diff --git a/layouts/_default/_markup/render-codeblock.html b/layouts/_default/_markup/render-codeblock.html
index 052efe3..21c5100 100644
--- a/layouts/_default/_markup/render-codeblock.html
+++ b/layouts/_default/_markup/render-codeblock.html
@@ -6,9 +6,9 @@
<button
class="codeblock-copy"
data-id="codeblock-id-{{ .Ordinal }}"
- data-copied-text="Copied!"
+ data-copied-text="{{ T `article.codeblock.copied` }}"
>
- Copy
+ {{ T `article.codeblock.copy` }}
</button>
</header>
<code id="codeblock-id-{{ .Ordinal }}" style="display:none;">{{- .Inner -}}</code>