]> git.maquefel.me Git - brevno-suite/hugo/commitdiff
tpl: HTTPS the instagram Shortcode JS
authorChristian Oliff <christianoliff@pm.me>
Wed, 26 Feb 2025 08:27:31 +0000 (17:27 +0900)
committerGitHub <noreply@github.com>
Wed, 26 Feb 2025 08:27:31 +0000 (09:27 +0100)
This JavaScript will always load over HTTPS so it's best to specify that. Protocol-less loaded resources are an anti-pattern (REF: https://www.paulirish.com/2010/the-protocol-relative-url/)

tpl/tplimpl/embedded/templates/shortcodes/instagram.html
tpl/tplimpl/shortcodes_integration_test.go

index 5d940d67b238be31c1435e379d0394ee39fc0f99..17188c6fd86a45072e231a427b3eba42fcf2540e 100644 (file)
     </div>
   </blockquote>
   {{- if not .pc.Simple -}}
-    <script async src="//www.instagram.com/embed.js"></script>
+    <script async src="https://www.instagram.com/embed.js"></script>
   {{- end -}}
 {{- end -}}
index b8a4ad83308461a362b7bac03883ed4e7f30613f..d669bb333745a51b5e21bd6eec642c8839bf0a00 100644 (file)
@@ -256,7 +256,7 @@ Content: {{ .Content }}
 
        // Regular mode
        b := hugolib.Test(t, files)
-       b.AssertFileContent("public/index.html", "a7937c49665872d3")
+       b.AssertFileContent("public/index.html", "6e93404b93277876")
 
        // Simple mode
        files = strings.ReplaceAll(files, "privacy.instagram.simple = false", "privacy.instagram.simple = true")