Browse Source

changes for including soundcite

master
Sean Dockray 3 years ago
parent
commit
91a6bf3545
2 changed files with 9 additions and 1 deletions
  1. +7
    -0
      themes/sandpoints/layouts/_default/_markup/render-image.html
  2. +2
    -1
      themes/sandpoints/layouts/partials/head.html

+ 7
- 0
themes/sandpoints/layouts/_default/_markup/render-image.html View File

@@ -38,6 +38,13 @@
<div>{{ .Text }}</div>
<audio src="{{- $a_destination | safeURL -}}" preload="metadata" controls="true"></audio>
{{- end -}}
{{- else if strings.HasPrefix .Destination "soundcite:" -}}
{{- $a_destination := (substr .Destination 10) -}}
{{- if findRE "^.*static" $a_destination -}}
<span class="soundcite" data-url="{{- (replaceRE "^.*static" "" $a_destination ) | safeURL -}}">{{ .Text }}</span>
{{- else -}}
<span class="soundcite" data-url="{{- $a_destination | safeURL -}}">{{ .Text }}</span>
{{- end -}}
{{- else if findRE "^.*static" .Destination -}}
<img src="{{- (replaceRE "^.*static" "" .Destination ) | safeURL -}}" alt="{{- .Text -}}" {{- with .Title}} title="{{- . -}}"{{- end -}} />
{{- else -}}


+ 2
- 1
themes/sandpoints/layouts/partials/head.html View File

@@ -28,5 +28,6 @@
{{ $sjsopts := dict "targetPath" "js/sandpoints.js" "minify" "true"}}
{{ $sjs := resources.Get "js/sandpoints.js" | js.Build $sjsopts }}
<script defer src='{{ $sjs.Permalink }}' type="application/javascript"></script>
<title>{{ block "title" . }}{{- .Title }} - {{ .Site.Title -}}{{ end }}</title>
<link href='https://cdn.knightlab.com/libs/soundcite/latest/css/player.css' rel='stylesheet' type='text/css'><script type='text/javascript' src='https://cdn.knightlab.com/libs/soundcite/latest/js/soundcite.min.js'></script>
<title>{{ block "title" . }}{{- .Title }} -- {{ .Site.Title -}}{{ end }}</title>
</head>

Loading…
Cancel
Save