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

@ -4,7 +4,7 @@
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'tabs' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration/#5180" $page.File.Path }}
{{- end }}
{{- $groupid := .groupid | default (partial "make-random-md5.hugo" $page) | plainify | anchorize }}
{{- $color := .color }}
{{- $color := .color }}
{{- $style := .style }}
{{- $title := .title }}
{{- $icon := .icon }}
@ -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) }}