i18n: update i18n string format (#371)

This commit is contained in:
Dillon
2020-05-18 16:10:24 +08:00
committed by GitHub
parent 36f59a72ee
commit 9c1244490f
35 changed files with 236 additions and 284 deletions

View File

@@ -5,7 +5,7 @@
window.dataLayer=window.dataLayer||[];function gtag(){dataLayer.push(arguments);}gtag('js', new Date());
gtag('config', '{{ . }}'{{ if $.google.anonymizeIP }}, { 'anonymize_ip': true }{{ end }});
</script>
{{- printf "https://www.googletagmanager.com/gtag/js?id=%s" . | dict "async" true "source" | partial "plugin/script.html" -}}
{{- printf "https://www.googletagmanager.com/gtag/js?id=%v" . | dict "async" true "source" | partial "plugin/script.html" -}}
{{- end -}}
{{- /* Fathom Analytics */ -}}
@@ -15,6 +15,6 @@
fathom('set', 'siteId', '{{ . }}');
fathom('trackPageview');
</script>
{{- dict "source" ($.fathom.server | default "cdn.usefathom.com" | printf "https://%s/tracker.js") "async" true "attr" "id=fathom-script" | partial "plugin/script.html" -}}
{{- dict "source" ($.fathom.server | default "cdn.usefathom.com" | printf "https://%v/tracker.js") "async" true "attr" "id=fathom-script" | partial "plugin/script.html" -}}
{{- end -}}
{{- end -}}

View File

@@ -11,7 +11,7 @@
{{- end -}}
{{- end -}}
{{- with $features | uniq -}}
{{- delimit . "%2C" | printf "https://polyfill.io/v3/polyfill.min.js?features=%s" | dict "source" | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
{{- delimit . "%2C" | printf "https://polyfill.io/v3/polyfill.min.js?features=%v" | dict "source" | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
{{- end -}}
{{- end -}}

View File

@@ -8,7 +8,7 @@
{{- $prefix = . -}}
{{- end -}}
{{- $prefix = $prefix | strings.TrimSuffix "/" -}}
{{- $src = printf "%s/%s.svg" $prefix . -}}
{{- $src = printf "%v/%v.svg" $prefix . -}}
{{- end -}}
{{- if (urls.Parse $src).Host | not -}}
{{- $src = (resources.Get $src | minify).RelPermalink -}}

View File

@@ -2,9 +2,9 @@
{{- with .url -}}
{{- $href = . | relLangURL -}}
{{- else -}}
{{- $template := .template | default "%s" -}}
{{- $template := .template | default "%v" -}}
{{- with .prefix -}}
{{- $template = . | strings.TrimSuffix "/" | printf "%s/%%s" -}}
{{- $template = . | strings.TrimSuffix "/" | printf "%v/%%v" -}}
{{- end -}}
{{- $href = printf (string $template) .id -}}
{{- end -}}