Skip to content

Commit 373835d

Browse files
fix(media): prefix img and video src with site.Home.RelPermalink
1 parent 04549c5 commit 373835d

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

themes/math-gallery-theme/layouts/shortcodes/img.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{{ else }}
44
<figure class="media-figure"{{ with .Get "id" }} id="{{ . }}"{{ end }}>
55
{{ end }}
6-
<img src="{{ .Get "src" }}"
6+
<img src="{{ site.Home.RelPermalink }}{{ .Get "src" | strings.TrimPrefix "/" }}"
77
alt="{{ with .Get "caption" }}{{ . }}{{ end }}"
88
loading="lazy" />
99
{{ with .Get "caption" }}<figcaption>{{ . }}</figcaption>{{ end }}

themes/math-gallery-theme/layouts/shortcodes/video.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<figure class="media-figure"{{ with .Get "id" }} id="{{ . }}"{{ end }}>
55
{{ end }}
66
<video controls>
7-
<source src="{{ .Get "src" }}" type="{{ with .Get "type" }}{{ . }}{{ else }}video/mp4{{ end }}">
7+
<source src="{{ site.Home.RelPermalink }}{{ .Get "src" | strings.TrimPrefix "/" }}" type="{{ with .Get "type" }}{{ . }}{{ else }}video/mp4{{ end }}">
88
Your browser does not support the video tag.
99
</video>
1010
{{ with .Get "caption" }}<figcaption>{{ . }}</figcaption>{{ end }}

0 commit comments

Comments
 (0)