diff --git a/assets/css/main.css b/assets/css/main.css index 8c245b1..885830c 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -360,6 +360,10 @@ div[itemprop="articleBody"] img { max-width: 100%; } +audio { + width: 100%; +} + /* Some images look blurry when scaled; this makes them easier to * read. */ .pix { diff --git a/layouts/shortcodes/audio.html b/layouts/shortcodes/audio.html new file mode 100644 index 0000000..2657327 --- /dev/null +++ b/layouts/shortcodes/audio.html @@ -0,0 +1,39 @@ +{{ $name := (.Get "name") -}} +{{- $opus := resources.GetMatch (printf "/a/%s.opus" $name) -}} +{{- $mp3 := resources.GetMatch (printf "/a/%s.mp3" $name) -}} +{{- $isTranscribed := false -}} +{{- /* preloading an in-page audio asset under 32 KiB is fine. */ -}} +{{- $shouldPreload := lt (len $opus.Content) 32768 -}} +{{- /* Strip trailing newline: https://github.com/gohugoio/hugo/issues/1753 */ -}} diff --git a/layouts/shortcodes/transcribed-image-transcript.html b/layouts/shortcodes/transcribed-image-transcript.html index d1b23e1..9eb41f3 100644 --- a/layouts/shortcodes/transcribed-image-transcript.html +++ b/layouts/shortcodes/transcribed-image-transcript.html @@ -1,14 +1,25 @@ -{{ with .Parent -}} +{{- $captionType := "embeddedTextCaption" -}} {{- $type := "image" -}} {{- with .Get "type" -}} {{- $type = . -}} {{- end -}} +{{ with .Parent -}} + {{- with .Get "type" -}} + {{- $type = . -}} + {{- end -}} + {{- if eq .Name "transcribed-audio" -}} + {{- $captionType = "transcript" -}} + {{- end -}}
Toggle {{ $type }} transcript
+{{ if eq (.Get "hlevel") "3" -}} +

{{ $type | humanize }} transcript

+{{- else -}}
{{ $type | humanize }} transcript
+{{- end -}} {{- end }} -
+
{{ .Inner | markdownify | safeHTML }}
diff --git a/layouts/shortcodes/transcribed-image.html b/layouts/shortcodes/transcribed-image.html index af7e339..875b91e 100644 --- a/layouts/shortcodes/transcribed-image.html +++ b/layouts/shortcodes/transcribed-image.html @@ -1,14 +1,24 @@ {{- $type := "image" -}} {{- $itemtype := "CreativeWork" -}} +{{- $itemtype2 := "ImageObject" -}} +{{- $itemprop := "mentions" -}} {{- with .Get "type" -}} -{{- $type = . -}} + {{- $type = . -}} {{- end -}} {{- with .Get "itemtype" -}} -{{- $itemtype = . -}} + {{- $itemtype = . -}} {{- end -}} +{{- with .Get "itemtype2" -}} + {{- $itemtype2 = . -}} +{{- end -}} +{{- with .Get "itemprop" -}} + {{- $itemprop = . -}} +{{- end -}} +
{{ .Inner | markdownify | safeHTML }}
+