Integrate <ruby-switch> into the templates
This commit is contained in:
parent
abb85f701d
commit
8022a8f84a
5 changed files with 25 additions and 25 deletions
|
@ -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>
|
||||
|
|
2
layouts/partials/resources/script.html
Normal file
2
layouts/partials/resources/script.html
Normal file
|
@ -0,0 +1,2 @@
|
|||
{{ $script := resources.Get (printf "scripts/%s.js" .) | fingerprint "md5" }}
|
||||
{{ return $script }}
|
|
@ -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 }}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue