{{- define "head" -}} {{- $current := replaceRE `[^0-9]` "" .File -}} {{- .Scratch.Set "title" .Site.Title -}} {{- .Scratch.Add "title" " #" -}} {{- .Scratch.Add "title" (replaceRE `[^0-9]` "" .File) -}} {{- partial "head.html" . -}} {{- end -}} {{- define "primary" -}} {{- $current := replaceRE `[^0-9]` "" .File -}} {{- partial "nav.html" . -}}

Tegaki Tuesday #{{- $current -}}

()()きの()(よう)()#{{- $current -}}・
{{- range.Params.japanese -}} {{- range. -}}

{{- range. -}} {{- if eq (printf "%T" .text) "string" -}} {{- $.Scratch.Set "dictionary" .text -}} {{- $.Scratch.Set "html" .text -}} {{- else -}} {{- $.Scratch.Set "dictionary" "" -}} {{- $.Scratch.Set "html" "" -}} {{- range.text -}} {{- if reflect.IsMap . -}} {{- range $kanji, $furigana := . -}} {{- $.Scratch.Add "dictionary" $kanji -}} {{- $.Scratch.Add "html" "" -}} {{- $.Scratch.Add "html" $kanji -}} {{- $.Scratch.Add "html" "(" -}} {{- $.Scratch.Add "html" $furigana -}} {{- $.Scratch.Add "html" ")" -}} {{- end -}} {{- else -}} {{- $.Scratch.Add "dictionary" . -}} {{- $.Scratch.Add "html" . -}} {{- end -}} {{- end -}} {{- if .dictionary -}} {{- $.Scratch.Set "dictionary" .dictionary -}} {{- end -}} {{- end -}} {{- if and (not .dictionary) (not .pos) -}} {{- $.Scratch.Get "html" | safeHTML -}} {{- else -}} {{- $.Scratch.Get "html" | safeHTML -}} {{- end -}} {{- end -}}

{{- end -}} {{- end -}}
{{- range.Params.english -}}

{{- $.RenderString . -}}

{{- end -}}
{{- range.Params.japanese -}} {{- range. -}}

{{- range. -}} {{- if eq (printf "%T" .text) "string" -}} {{- .text -}} {{- else -}} {{- range.text -}} {{- if reflect.IsMap . -}} {{- range $kanji, $furigana := . -}} {{- $kanji -}}({{- $furigana -}}) {{- end -}} {{- else -}} {{- . -}} {{- end -}} {{- end -}} {{- end -}} {{- end -}}

{{- end -}} {{- end -}}
{{- partial "content.html" . -}}
{{- end -}} {{- define "secondary" -}} {{- $current := replaceRE `[^0-9]` "" .File -}}
{{- range index .Site.Data.challenges ($current) -}} {{- $submission := . -}} {{- range.images -}} {{- $path := printf "%s" . | printf "%s%s" "/" | printf "%s%s" $current | printf "%s" -}} {{- $image := resources.Get $path -}} {{- partial "submission.html" (dict "submission" $submission "challenge" $current "image" $image) -}} {{- end -}} {{- end -}}
{{- end -}} {{- define "secondaryFooter" -}} {{- partial "footer.html" (partial "footers/submissions.html" .) -}} {{- end -}}