|
|
|
@ -10,92 +10,96 @@
|
|
|
|
|
{{- $current := replaceRE `[^0-9]` "" .File -}}
|
|
|
|
|
{{- partial "nav.html" . -}}
|
|
|
|
|
<div id="challenge">
|
|
|
|
|
<div>
|
|
|
|
|
<button id="direction" title="Text direction">↕</button>
|
|
|
|
|
<button lang="ja" id="highlight" title="Vocab/kanji links">漢字</button>
|
|
|
|
|
<button lang="ja" id="kyujitai" title="Shinjitai/kyujitai">旧字体</button>
|
|
|
|
|
<a target="_blank" class="clickable-icon" href="https://en.wikipedia.org/wiki/Ky%C5%ABjitai"><i class="fa-solid fa-circle-question"></i></a>
|
|
|
|
|
<header>
|
|
|
|
|
<h3>Tegaki Tuesday #{{- $current -}}</h3>
|
|
|
|
|
<small><ruby>手<rp>(</rp><rt>て</rt><rp>)</rp></ruby><ruby>書<rp>(</rp><rt>が</rt><rp>)</rp></ruby>きの<ruby>火<rp>(</rp><rt>か</rt><rp>)</rp></ruby><ruby>曜<rp>(</rp><rt>よう</rt><rp>)</rp></ruby><ruby>日<rp>(</rp><rt>び</rt><rp>)</rp></ruby>#{{- $current -}}・<time datetime="{{- .Date.Format " 2006-01-02T15:04:05Z07:00" -}}">{{- .Date.Format "2006年01月02日" -}}</time></small>
|
|
|
|
|
</header>
|
|
|
|
|
{{ if or (.Params.japanese) (.Params.english) }}
|
|
|
|
|
<div id="challenge-container">
|
|
|
|
|
<div id="challenge-horizontal">
|
|
|
|
|
<div id="challenge-vocab" lang="ja">
|
|
|
|
|
<!-- Vocab view -->
|
|
|
|
|
<!-- Outer list: lines -->
|
|
|
|
|
{{- range.Params.japanese -}}
|
|
|
|
|
<!-- Inner list: sublines -->
|
|
|
|
|
{{- range. -}}
|
|
|
|
|
<!-- Innermost list: words -->
|
|
|
|
|
<p>{{- 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" "<ruby>" -}}
|
|
|
|
|
{{- $.Scratch.Add "html" $kanji -}}
|
|
|
|
|
{{- $.Scratch.Add "html" "<rp>(</rp><rt>" -}}
|
|
|
|
|
{{- $.Scratch.Add "html" $furigana -}}
|
|
|
|
|
{{- $.Scratch.Add "html" "</rt><rp>)</rp></ruby>" -}}
|
|
|
|
|
{{- end -}}
|
|
|
|
|
{{- else -}}
|
|
|
|
|
{{- $.Scratch.Add "dictionary" . -}}
|
|
|
|
|
{{- $.Scratch.Add "html" . -}}
|
|
|
|
|
{{- end -}}
|
|
|
|
|
{{- end -}}
|
|
|
|
|
{{- end -}}
|
|
|
|
|
{{ if .dictionary }}
|
|
|
|
|
{{- $.Scratch.Set "dictionary" .dictionary -}}
|
|
|
|
|
{{ end }}
|
|
|
|
|
{{- if not (and .dictionary (hasPrefix .dictionary "http")) -}}
|
|
|
|
|
{{- $.Scratch.Set "dictionary" (printf "%s" ($.Scratch.Get "dictionary") | printf "%s%s" "https://jisho.org/word/" | printf "%s") -}}
|
|
|
|
|
{{- end -}}
|
|
|
|
|
{{- if and (not .dictionary) (not .pos) -}}
|
|
|
|
|
{{- $.Scratch.Get "html" | safeHTML -}}
|
|
|
|
|
{{- else -}}
|
|
|
|
|
<a href="{{- $.Scratch.Get "dictionary" -}}" class="{{- .pos -}}" title="{{- .pos -}}" target="_blank">{{- $.Scratch.Get "html" | safeHTML -}}</a>
|
|
|
|
|
{{ if .Params.english }}
|
|
|
|
|
<div id="challenge-english">
|
|
|
|
|
<!-- English view -->
|
|
|
|
|
{{- range.Params.english -}}
|
|
|
|
|
<p>{{- $.RenderString . -}}</p>
|
|
|
|
|
{{- end -}}
|
|
|
|
|
</div>
|
|
|
|
|
<br>
|
|
|
|
|
{{ end }}
|
|
|
|
|
<div id="challenge-vocab" lang="ja">
|
|
|
|
|
<!-- Vocab view -->
|
|
|
|
|
<!-- Outer list: lines -->
|
|
|
|
|
{{- range.Params.japanese -}}
|
|
|
|
|
<!-- Inner list: sublines -->
|
|
|
|
|
{{- range. -}}
|
|
|
|
|
<!-- Innermost list: words -->
|
|
|
|
|
<p>{{- 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" "<ruby>" -}}
|
|
|
|
|
{{- $.Scratch.Add "html" $kanji -}}
|
|
|
|
|
{{- $.Scratch.Add "html" "<rp>(</rp><rt>" -}}
|
|
|
|
|
{{- $.Scratch.Add "html" $furigana -}}
|
|
|
|
|
{{- $.Scratch.Add "html" "</rt><rp>)</rp></ruby>" -}}
|
|
|
|
|
{{- end -}}
|
|
|
|
|
{{- end -}}</p>
|
|
|
|
|
{{- else -}}
|
|
|
|
|
{{- $.Scratch.Add "dictionary" . -}}
|
|
|
|
|
{{- $.Scratch.Add "html" . -}}
|
|
|
|
|
{{- end -}}
|
|
|
|
|
{{- end -}}
|
|
|
|
|
{{- end -}}
|
|
|
|
|
</div>
|
|
|
|
|
<div id="challenge-english">
|
|
|
|
|
<!-- English view -->
|
|
|
|
|
{{- range.Params.english -}}
|
|
|
|
|
<p>{{- $.RenderString . -}}</p>
|
|
|
|
|
{{ if .dictionary }}
|
|
|
|
|
{{- $.Scratch.Set "dictionary" .dictionary -}}
|
|
|
|
|
{{ end }}
|
|
|
|
|
{{- if not (and .dictionary (hasPrefix .dictionary "http")) -}}
|
|
|
|
|
{{- $.Scratch.Set "dictionary" (printf "%s" ($.Scratch.Get "dictionary") | printf "%s%s" "https://jisho.org/word/" | printf "%s") -}}
|
|
|
|
|
{{- end -}}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div id="challenge-kanji" lang="ja">
|
|
|
|
|
<!-- Kanji view -->
|
|
|
|
|
<!-- Outer list: lines -->
|
|
|
|
|
{{- range.Params.japanese -}}
|
|
|
|
|
<!-- Inner list: sublines -->
|
|
|
|
|
{{- range. -}}
|
|
|
|
|
<!-- Innermost list: words -->
|
|
|
|
|
<p>{{- range. -}}
|
|
|
|
|
{{- if eq (printf "%T" .text) "string" -}}
|
|
|
|
|
{{- .text -}}
|
|
|
|
|
{{- else -}}
|
|
|
|
|
{{- range.text -}}
|
|
|
|
|
{{- if reflect.IsMap . -}}
|
|
|
|
|
{{- range $kanji, $furigana := . -}}
|
|
|
|
|
<a href="https://jisho.org/search/{{- $kanji -}} %23kanji" target="_blank"><ruby>{{- $kanji | safeHTML -}}<rp>(</rp><rt>{{- $furigana | safeHTML -}}</rt><rp>)</rp></ruby></a>
|
|
|
|
|
{{- end -}}
|
|
|
|
|
{{- else -}}
|
|
|
|
|
{{- . -}}
|
|
|
|
|
{{- end -}}
|
|
|
|
|
{{- if and (not .dictionary) (not .pos) -}}
|
|
|
|
|
{{- $.Scratch.Get "html" | safeHTML -}}
|
|
|
|
|
{{- else -}}
|
|
|
|
|
<a href="{{- $.Scratch.Get "dictionary" -}}" class="{{- .pos -}}" title="{{- .pos -}}" target="_blank">{{- $.Scratch.Get "html" | safeHTML -}}</a>
|
|
|
|
|
{{- end -}}
|
|
|
|
|
{{- end -}}</p>
|
|
|
|
|
{{- end -}}
|
|
|
|
|
{{- end -}}
|
|
|
|
|
</div>
|
|
|
|
|
<div id="challenge-kanji" lang="ja" style="display: none">
|
|
|
|
|
<!-- Kanji view -->
|
|
|
|
|
<!-- Outer list: lines -->
|
|
|
|
|
{{- range.Params.japanese -}}
|
|
|
|
|
<!-- Inner list: sublines -->
|
|
|
|
|
{{- range. -}}
|
|
|
|
|
<!-- Innermost list: words -->
|
|
|
|
|
<p>{{- range. -}}
|
|
|
|
|
{{- if eq (printf "%T" .text) "string" -}}
|
|
|
|
|
{{- .text -}}
|
|
|
|
|
{{- else -}}
|
|
|
|
|
{{- range.text -}}
|
|
|
|
|
{{- if reflect.IsMap . -}}
|
|
|
|
|
{{- range $kanji, $furigana := . -}}
|
|
|
|
|
<a href="https://jisho.org/search/{{- $kanji -}} %23kanji" target="_blank"><ruby>{{- $kanji | safeHTML -}}<rp>(</rp><rt>{{- $furigana | safeHTML -}}</rt><rp>)</rp></ruby></a>
|
|
|
|
|
{{- end -}}
|
|
|
|
|
{{- else -}}
|
|
|
|
|
{{- . -}}
|
|
|
|
|
{{- end -}}
|
|
|
|
|
{{- end -}}</p>
|
|
|
|
|
{{- end -}}
|
|
|
|
|
{{- end -}}
|
|
|
|
|
{{- end -}}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
{{ end }}
|
|
|
|
|
{{- end -}}</p>
|
|
|
|
|
{{- end -}}
|
|
|
|
|
{{- end -}}
|
|
|
|
|
</div>
|
|
|
|
|
<script src="/js/toggle.js"></script>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="content">
|
|
|
|
|
{{- partial "content.html" . -}}
|
|
|
|
|