feat: enable Wowchemy attribution to be translated

Add EN and ZH translations.

See https://github.com/wowchemy/wowchemy-hugo-modules/discussions/2161
This commit is contained in:
George Cushen committed 2021-02-25 18:14:21 +00:00
1 parent ad6e481c0a
commit 6b9fdd9482
4 files changed
+26 -5

No files matched your search

+6 -1
View File
@@ -216,7 +216,7 @@
- id: slides
translation: Slides
- id: authors
translation: Authors
@@ -255,3 +255,8 @@
- id: cookie_learn
translation: Learn more
# Published with
- id: published_with
translation: Published with {wowchemy} — the free, {repo_link}open source{/repo_link} website builder that empowers creators.
+5
View File
@@ -223,3 +223,8 @@
- id: cookie_learn
translation: 了解更多
# Published with
- id: published_with
translation: 由{wowchemy}支持发布——免费{repo_link}开源{/repo_link}网站,为创作者赋能。
+5
View File
@@ -234,3 +234,8 @@
- id: cookie_learn
translation: 了解更多
# Published with
- id: published_with
translation: 由{wowchemy}支持发布——免费{repo_link}开源{/repo_link}网站,为创作者赋能。
+10 -4
View File
@@ -22,10 +22,16 @@
{{ $is_sponsor := site.Params.i_am_a_sponsor | default false }}
{{ $hide_published_with_footer := site.Params.power_ups.hide_published_with | default true }}
{{ if not (and $is_sponsor $hide_published_with_footer) }}
Published with
<a href="https://wowchemy.com/?utm_campaign=poweredby" target="_blank" rel="noopener">Wowchemy</a> —
the free, <a href="https://github.com/wowchemy/wowchemy-hugo-modules" target="_blank" rel="noopener">
open source</a> website builder that empowers creators.
{{ $default := "Published with {wowchemy} — the free, {repo_link}open source{/repo_link} website builder that empowers creators." }}
{{ $i18n_published_with := i18n "published_with" | default $default }}
{{ if not (findRE "{wowchemy}" $i18n_published_with) }}
{{ warnf "Please attribute Wowchemy using `{wowchemy}` in the `published_with` text." }}
{{ $i18n_published_with = $default }}
{{ end }}
{{ $i18n_published_with = replace $i18n_published_with "{wowchemy}" "<a href=\"https://wowchemy.com/?utm_campaign=poweredby\" target=\"_blank\" rel=\"noopener\">Wowchemy</a>" | safeHTML }}
{{ $i18n_published_with = replace $i18n_published_with "{repo_link}" "<a href=\"https://github.com/wowchemy/wowchemy-hugo-modules\" target=\"_blank\" rel=\"noopener\">" | safeHTML }}
{{ $i18n_published_with = replace $i18n_published_with "{/repo_link}" "</a>" | safeHTML }}
{{ $i18n_published_with | markdownify | emojify }}
{{ end }}
</p>
</footer>