Kaynağa Gözat

changes for including soundcite

master
Sean Dockray 4 yıl önce
ebeveyn
işleme
91a6bf3545
2 değiştirilmiş dosya ile 9 ekleme ve 1 silme
  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 Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

@@ -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>

Yükleniyor…
İptal
Kaydet