theme: remove warnings with hugo --printI18nWarnings #670

This commit is contained in:
Sören Weber 2023-10-03 01:28:24 +02:00
parent 977e4c5ab2
commit 5d5f288bbf
No known key found for this signature in database
GPG Key ID: BEC6D55545451B6D
5 changed files with 44 additions and 8 deletions

View File

@ -12,8 +12,14 @@
{{- if and (not $color) (eq (len $color) 0) }}
{{- $style = .style | default "transparent" }}
{{- end }}
{{- $title := .title | default ($style | T) | default ("Attachments-label" | T) }}
{{- $title = trim $title " " }}
{{- $title := .title }}
{{- if not $title }}
{{- if eq $style "info" }}{{ $title = $style | T }}{{ end }}
{{- if eq $style "warning" }}{{ $title = $style | T }}{{ end }}
{{- if eq $style "note" }}{{ $title = $style | T }}{{ end }}
{{- if eq $style "tip" }}{{ $title = $style | T }}{{ end }}
{{- end }}
{{- $title = trim ($title | default ("Attachments-label" | T)) " " }}
{{- $icon := .icon | default "" }}
{{- if and (not $icon) (eq (len $icon) 0) }}
{{- $icon = "paperclip" }}

View File

@ -6,7 +6,13 @@
{{- $color := .color | default "" }}
{{- $content := .content }}
{{- $style := .style | default "default" }}
{{- $title := .title | default ($style | T) }}
{{- $title := .title }}
{{- if not $title }}
{{- if eq $style "info" }}{{ $title = $style | T }}{{ end }}
{{- if eq $style "warning" }}{{ $title = $style | T }}{{ end }}
{{- if eq $style "note" }}{{ $title = $style | T }}{{ end }}
{{- if eq $style "tip" }}{{ $title = $style | T }}{{ end }}
{{- end }}
{{- $title = trim $title " " }}
{{- $icon := .icon | default "" }}
{{- if and (not $icon) (eq (len $icon) 0) }}

View File

@ -25,7 +25,13 @@
{{- $target = $page.Site.Params.externalLinkTarget }}
{{- end }}
{{- end }}
{{- $title := .title | default ($content) | default ($style | T) }}
{{- $title := .title | default ($content) }}
{{- if not $title }}
{{- if eq $style "info" }}{{ $title = $style | T }}{{ end }}
{{- if eq $style "warning" }}{{ $title = $style | T }}{{ end }}
{{- if eq $style "note" }}{{ $title = $style | T }}{{ end }}
{{- if eq $style "tip" }}{{ $title = $style | T }}{{ end }}
{{- end }}
{{- $title = trim $title " " }}
{{- $icon := .icon | default "" }}
{{- if and (not $icon) (eq (len $icon) 0) }}

View File

@ -6,7 +6,13 @@
{{- $color := .color | default "" }}
{{- $content := .content }}
{{- $style := .style | default "default" }}
{{- $title := .title | default ($style | T) }}
{{- $title := .title }}
{{- if not $title }}
{{- if eq $style "info" }}{{ $title = $style | T }}{{ end }}
{{- if eq $style "warning" }}{{ $title = $style | T }}{{ end }}
{{- if eq $style "note" }}{{ $title = $style | T }}{{ end }}
{{- if eq $style "tip" }}{{ $title = $style | T }}{{ end }}
{{- end }}
{{- $title = trim $title " " }}
{{- $icon := .icon | default "" }}
{{- if and (not $icon) (eq (len $icon) 0) }}

View File

@ -17,7 +17,13 @@
{{- with $tab }}
{{- $color := .color | default $color | default "" }}
{{- $style := .style | default $style | default (cond (ne $color "") "filled" "initial") }}
{{- $title := .title | default ($style | T) }}
{{- $title := .title }}
{{- if not $title }}
{{- if eq $style "info" }}{{ $title = $style | T }}{{ end }}
{{- if eq $style "warning" }}{{ $title = $style | T }}{{ end }}
{{- if eq $style "note" }}{{ $title = $style | T }}{{ end }}
{{- if eq $style "tip" }}{{ $title = $style | T }}{{ end }}
{{- end }}
{{- $title = trim $title " " }}
{{- $icon := .icon | default "" }}
{{- if and (not $icon) (eq (len $icon) 0) }}
@ -42,7 +48,13 @@
{{- end }}
{{- $color = .color | default "" }}
{{- $style = .style | default (cond (ne $color "") "filled" "initial") }}
{{- $title = .title | default ($style | T) }}
{{- $title = .title }}
{{- if not $title }}
{{- if eq $style "info" }}{{ $title = $style | T }}{{ end }}
{{- if eq $style "warning" }}{{ $title = $style | T }}{{ end }}
{{- if eq $style "note" }}{{ $title = $style | T }}{{ end }}
{{- if eq $style "tip" }}{{ $title = $style | T }}{{ end }}
{{- end }}
{{- $title = trim $title " " }}
{{- $icon = .icon | default "" }}
{{- if and (not $icon) (eq (len $icon) 0) }}