diff --git a/content/challenges/59.md b/content/challenges/59.md new file mode 100644 index 0000000..2dae978 --- /dev/null +++ b/content/challenges/59.md @@ -0,0 +1,7 @@ +--- +date: 2022-04-12 +--- + +This week's challenge is open-ended! **Write down your favorite thing about spring** and submit it; it can be as short or long as you like. (If you're feeling adventurous, draw it as well, perhaps? :cherry_blossom:) + +Depending on how this goes, we me have more open-ended challenges in the future, we'll see... \ No newline at end of file diff --git a/themes/tegakituesday.com/layouts/challenges/single.html b/themes/tegakituesday.com/layouts/challenges/single.html index 8f8e0e7..86c3482 100644 --- a/themes/tegakituesday.com/layouts/challenges/single.html +++ b/themes/tegakituesday.com/layouts/challenges/single.html @@ -14,10 +14,60 @@
{{- 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" "" -}} + {{- end -}} + {{- else -}} + {{- $.Scratch.Add "dictionary" . -}} + {{- $.Scratch.Add "html" . -}} + {{- end -}} + {{- end -}} + {{- end -}} + {{- if .dictionary -}} + {{- $.Scratch.Set "dictionary" .dictionary -}} + {{- end -}} + {{- if and (not .dictionary) (not .pos) -}} + {{- $.Scratch.Get "html" | safeHTML -}} + {{- else -}} + {{- $.Scratch.Get "html" | safeHTML -}} + {{- end -}} + {{- end -}}
+ {{- end -}} + {{- end -}} +{{- $.RenderString . -}}
+ {{- end -}} +{{- range. -}} {{- if eq (printf "%T" .text) "string" -}} - {{- $.Scratch.Set "dictionary" .text -}} - {{- $.Scratch.Set "html" .text -}} + {{- .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" "" -}} + {{- $kanji -}} {{- end -}} {{- else -}} - {{- $.Scratch.Add "dictionary" . -}} - {{- $.Scratch.Add "html" . -}} + {{- . -}} {{- end -}} {{- end -}} {{- end -}} - {{- if .dictionary -}} - {{- $.Scratch.Set "dictionary" .dictionary -}} - {{- end -}} - {{- if and (not .dictionary) (not .pos) -}} - {{- $.Scratch.Get "html" | safeHTML -}} - {{- else -}} - {{- $.Scratch.Get "html" | safeHTML -}} - {{- end -}} {{- end -}}
{{- end -}} {{- end -}}{{- $.RenderString . -}}
- {{- end -}} -{{- range. -}} - {{- if eq (printf "%T" .text) "string" -}} - {{- .text -}} - {{- else -}} - {{- range.text -}} - {{- if reflect.IsMap . -}} - {{- range $kanji, $furigana := . -}} - {{- $kanji -}} - {{- end -}} - {{- else -}} - {{- . -}} - {{- end -}} - {{- end -}} - {{- end -}} - {{- end -}}
- {{- end -}} - {{- end -}}