Integrate <ruby-switch> into the templates

This commit is contained in:
Eryn Wells 2023-10-14 14:55:54 -07:00
parent abb85f701d
commit 8022a8f84a
5 changed files with 25 additions and 25 deletions

View file

@ -30,6 +30,11 @@
{{ block "scripts" . }}{{ end }}
{{- with partial "resources/site_js.html" . -}}
<script type="module" src="{{ .RelPermalink }}"></script>
<script type="module" src="{{ .Permalink }}"></script>
{{ end }}
{{ if .HasShortcode "ruby" }}
{{ with partial "resources/script.html" "ruby_switch" }}
<script type="module" src="{{ .Permalink }}"></script>
{{ end }}
{{ end }}
</html>

View file

@ -0,0 +1,2 @@
{{ $script := resources.Get (printf "scripts/%s.js" .) | fingerprint "md5" }}
{{ return $script }}

View file

@ -1,13 +1,5 @@
{{ if .HasShortcode "ruby" -}}
<aside>
<fieldset id="ruby-controls">
<legend>Ruby</legend>
<input id="none" type="radio" name="ruby-controls" value="NONE">
<label for="none">Japanese Only</label>
<input id="both" type="radio" name="ruby-controls" value="BOTH" checked>
<label for="both">Both</label>
<input id=hidden type=radio name=ruby-controls value=HIDDEN>
<label for=hidden>English Only</label>
</fieldset>
<ruby-switch>
</aside>
{{- end }}