|
|
@ -10,92 +10,96 @@
|
|
|
|
{{- $current := replaceRE `[^0-9]` "" .File -}}
|
|
|
|
{{- $current := replaceRE `[^0-9]` "" .File -}}
|
|
|
|
{{- partial "nav.html" . -}}
|
|
|
|
{{- partial "nav.html" . -}}
|
|
|
|
<div id="challenge">
|
|
|
|
<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>
|
|
|
|
<header>
|
|
|
|
<h3>Tegaki Tuesday #{{- $current -}}</h3>
|
|
|
|
<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>
|
|
|
|
<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>
|
|
|
|
</header>
|
|
|
|
{{ if or (.Params.japanese) (.Params.english) }}
|
|
|
|
{{ if .Params.english }}
|
|
|
|
<div id="challenge-container">
|
|
|
|
<div id="challenge-english">
|
|
|
|
<div id="challenge-horizontal">
|
|
|
|
<!-- English view -->
|
|
|
|
<div id="challenge-vocab" lang="ja">
|
|
|
|
{{- range.Params.english -}}
|
|
|
|
<!-- Vocab view -->
|
|
|
|
<p>{{- $.RenderString . -}}</p>
|
|
|
|
<!-- Outer list: lines -->
|
|
|
|
{{- end -}}
|
|
|
|
{{- range.Params.japanese -}}
|
|
|
|
</div>
|
|
|
|
<!-- Inner list: sublines -->
|
|
|
|
<br>
|
|
|
|
{{- range. -}}
|
|
|
|
{{ end }}
|
|
|
|
<!-- Innermost list: words -->
|
|
|
|
<div id="challenge-vocab" lang="ja">
|
|
|
|
<p>{{- range. -}}
|
|
|
|
<!-- Vocab view -->
|
|
|
|
{{- if eq (printf "%T" .text) "string" -}}
|
|
|
|
<!-- Outer list: lines -->
|
|
|
|
{{- $.Scratch.Set "dictionary" .text -}}
|
|
|
|
{{- range.Params.japanese -}}
|
|
|
|
{{- $.Scratch.Set "html" .text -}}
|
|
|
|
<!-- Inner list: sublines -->
|
|
|
|
{{- else -}}
|
|
|
|
{{- range. -}}
|
|
|
|
{{- $.Scratch.Set "dictionary" "" -}}
|
|
|
|
<!-- Innermost list: words -->
|
|
|
|
{{- $.Scratch.Set "html" "" -}}
|
|
|
|
<p>{{- range. -}}
|
|
|
|
{{- range.text -}}
|
|
|
|
{{- if eq (printf "%T" .text) "string" -}}
|
|
|
|
{{- if reflect.IsMap . -}}
|
|
|
|
{{- $.Scratch.Set "dictionary" .text -}}
|
|
|
|
{{- range $kanji, $furigana := . -}}
|
|
|
|
{{- $.Scratch.Set "html" .text -}}
|
|
|
|
{{- $.Scratch.Add "dictionary" $kanji -}}
|
|
|
|
{{- else -}}
|
|
|
|
{{- $.Scratch.Add "html" "<ruby>" -}}
|
|
|
|
{{- $.Scratch.Set "dictionary" "" -}}
|
|
|
|
{{- $.Scratch.Add "html" $kanji -}}
|
|
|
|
{{- $.Scratch.Set "html" "" -}}
|
|
|
|
{{- $.Scratch.Add "html" "<rp>(</rp><rt>" -}}
|
|
|
|
{{- range.text -}}
|
|
|
|
{{- $.Scratch.Add "html" $furigana -}}
|
|
|
|
{{- if reflect.IsMap . -}}
|
|
|
|
{{- $.Scratch.Add "html" "</rt><rp>)</rp></ruby>" -}}
|
|
|
|
{{- range $kanji, $furigana := . -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- $.Scratch.Add "dictionary" $kanji -}}
|
|
|
|
{{- else -}}
|
|
|
|
{{- $.Scratch.Add "html" "<ruby>" -}}
|
|
|
|
{{- $.Scratch.Add "dictionary" . -}}
|
|
|
|
{{- $.Scratch.Add "html" $kanji -}}
|
|
|
|
{{- $.Scratch.Add "html" . -}}
|
|
|
|
{{- $.Scratch.Add "html" "<rp>(</rp><rt>" -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- $.Scratch.Add "html" $furigana -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- $.Scratch.Add "html" "</rt><rp>)</rp></ruby>" -}}
|
|
|
|
{{- 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>
|
|
|
|
|
|
|
|
{{- end -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- end -}}</p>
|
|
|
|
{{- else -}}
|
|
|
|
|
|
|
|
{{- $.Scratch.Add "dictionary" . -}}
|
|
|
|
|
|
|
|
{{- $.Scratch.Add "html" . -}}
|
|
|
|
|
|
|
|
{{- end -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- end -}}
|
|
|
|
</div>
|
|
|
|
{{ if .dictionary }}
|
|
|
|
<div id="challenge-english">
|
|
|
|
{{- $.Scratch.Set "dictionary" .dictionary -}}
|
|
|
|
<!-- English view -->
|
|
|
|
{{ end }}
|
|
|
|
{{- range.Params.english -}}
|
|
|
|
{{- if not (and .dictionary (hasPrefix .dictionary "http")) -}}
|
|
|
|
<p>{{- $.RenderString . -}}</p>
|
|
|
|
{{- $.Scratch.Set "dictionary" (printf "%s" ($.Scratch.Get "dictionary") | printf "%s%s" "https://jisho.org/word/" | printf "%s") -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- end -}}
|
|
|
|
</div>
|
|
|
|
{{- if and (not .dictionary) (not .pos) -}}
|
|
|
|
</div>
|
|
|
|
{{- $.Scratch.Get "html" | safeHTML -}}
|
|
|
|
<div id="challenge-kanji" lang="ja">
|
|
|
|
{{- else -}}
|
|
|
|
<!-- Kanji view -->
|
|
|
|
<a href="{{- $.Scratch.Get "dictionary" -}}" class="{{- .pos -}}" title="{{- .pos -}}" target="_blank">{{- $.Scratch.Get "html" | safeHTML -}}</a>
|
|
|
|
<!-- Outer list: lines -->
|
|
|
|
{{- end -}}
|
|
|
|
{{- range.Params.japanese -}}
|
|
|
|
{{- end -}}</p>
|
|
|
|
<!-- Inner list: sublines -->
|
|
|
|
{{- end -}}
|
|
|
|
{{- range. -}}
|
|
|
|
{{- end -}}
|
|
|
|
<!-- Innermost list: words -->
|
|
|
|
</div>
|
|
|
|
<p>{{- range. -}}
|
|
|
|
<div id="challenge-kanji" lang="ja" style="display: none">
|
|
|
|
{{- if eq (printf "%T" .text) "string" -}}
|
|
|
|
<!-- Kanji view -->
|
|
|
|
{{- .text -}}
|
|
|
|
<!-- Outer list: lines -->
|
|
|
|
{{- else -}}
|
|
|
|
{{- range.Params.japanese -}}
|
|
|
|
{{- range.text -}}
|
|
|
|
<!-- Inner list: sublines -->
|
|
|
|
{{- if reflect.IsMap . -}}
|
|
|
|
{{- range. -}}
|
|
|
|
{{- range $kanji, $furigana := . -}}
|
|
|
|
<!-- Innermost list: words -->
|
|
|
|
<a href="https://jisho.org/search/{{- $kanji -}} %23kanji" target="_blank"><ruby>{{- $kanji | safeHTML -}}<rp>(</rp><rt>{{- $furigana | safeHTML -}}</rt><rp>)</rp></ruby></a>
|
|
|
|
<p>{{- range. -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- if eq (printf "%T" .text) "string" -}}
|
|
|
|
{{- else -}}
|
|
|
|
{{- .text -}}
|
|
|
|
{{- . -}}
|
|
|
|
{{- else -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- 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 -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{- else -}}
|
|
|
|
|
|
|
|
{{- . -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- end -}}</p>
|
|
|
|
{{- end -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- end -}}</p>
|
|
|
|
</div>
|
|
|
|
{{- end -}}
|
|
|
|
</div>
|
|
|
|
{{- end -}}
|
|
|
|
{{ end }}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<script src="/js/toggle.js"></script>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="content">
|
|
|
|
<div class="content">
|
|
|
|
{{- partial "content.html" . -}}
|
|
|
|
{{- partial "content.html" . -}}
|
|
|
|