Merge branch 'main' into massive-relayout
# Conflicts: # assets/styles/root/050_ruby_controls.css # layouts/partials/ruby_controls.html
This commit is contained in:
commit
d45ad449a5
12 changed files with 269 additions and 70 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>
|
||||
|
|
|
@ -1,13 +1,18 @@
|
|||
{{ $orientation := .Exif.Tags.Orientation }}
|
||||
{{/* EXIF orientation is specified as an integer corresponding to a 90º rotation. */}}
|
||||
{{ $angle := 0 }}
|
||||
{{ if in (slice 1 2) $orientation }}
|
||||
{{ $orientation = 0 }}
|
||||
{{ else if in (slice 3 4) $orientation }}
|
||||
{{ $orientation = 180 }}
|
||||
{{ else if in (slice 5 6) $orientation }}
|
||||
{{ $orientation = 90 }}
|
||||
{{ else if in (slice 7 8) $orientation }}
|
||||
{{ $orientation = 270 }}
|
||||
{{ $orientation := 0 }}
|
||||
|
||||
{{ with (int .Exif.Tags.Orientation) }}
|
||||
{{/* EXIF orientation is specified as an integer corresponding to a 90º rotation. */}}
|
||||
{{ if in (slice 1 2) . }}
|
||||
{{ $orientation = 0 }}
|
||||
{{ else if in (slice 3 4) . }}
|
||||
{{ $orientation = 180 }}
|
||||
{{ else if in (slice 5 6) . }}
|
||||
{{ $orientation = 90 }}
|
||||
{{ else if in (slice 7 8) . }}
|
||||
{{ $orientation = 270 }}
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
{{ warnf "Image missing orientation: %s" . }}
|
||||
{{ end }}
|
||||
|
||||
{{ return $orientation }}
|
||||
|
|
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=ruby-controls-none type=radio name=ruby-controls value=NONE>
|
||||
<label for=ruby-controls-none>Japanese Only</label>
|
||||
<input id=ruby-controls-both type=radio name=ruby-controls value=BOTH checked>
|
||||
<label for=ruby-controls-both>Both</label>
|
||||
<input id=ruby-controls-hidden type=radio name=ruby-controls value=HIDDEN>
|
||||
<label for=ruby-controls-hidden>English Only</label>
|
||||
</fieldset>
|
||||
<ruby-switch>
|
||||
</aside>
|
||||
{{- end }}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue