diff options
-rw-r--r-- | layouts/partials/utils/content.html | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/layouts/partials/utils/content.html b/layouts/partials/utils/content.html index 05ec4c4..1adcd85 100644 --- a/layouts/partials/utils/content.html +++ b/layouts/partials/utils/content.html @@ -129,14 +129,14 @@ <!-- Video Hosting --> {{- if and .Site.Params.enableVideoHost (eq hugo.Environment "production") -}} - {{- $hostURL := .Site.Params.videoHostURL -}} + {{- $hostURL := strings.TrimSuffix "/" .Site.Params.videoHostURL -}} {{- $temps := findRE `<(video) src="/?([^":]+)` $Content | uniq -}} {{- with $temps -}} {{- range . -}} {{- if not (in (slice "http" "ttps") (substr . -1 4)) -}} {{- $url := replaceRE `<(video) src="/?([^":]+)` `$2` . -}} {{- $prefix := replaceRE `(<(video) src=")/?([^":]+)` `$1` . -}} - {{- $replacement := (printf `%s%s%s` $prefix $hostURL $url) -}} + {{- $replacement := (printf `%s%s/%s` $prefix $hostURL $url) -}} {{- $Content = replace $Content . $replacement -}} {{- end -}} {{- end -}} |