alups
October 21, 2019, 5:54am
1
Hi, all
I use hugo in local server with http, works well, but when I publish to github, my browser compain:
Mixed Content: The page at ‘https://myname.github.io/ ’ was loaded over HTTPS, but requested an insecure stylesheet ‘http://myname.github.io/sass/main.min.efb631bfd6d06f69412228c8e8394e1b0993664013282ad6d79b7aba11a9efd0.css ’. This request has been blocked; the content must be served over HTTPS.
from source page I got this:
Now, in my partial/header.html:
{{ $style := resources.Get "sass/main.scss" | toCSS | minify | fingerprint }}
<link rel="stylesheet" href="{{ $style.Permalink }}">
BTW, I use docker jojomi/hugo to generate the static website file.
My question is how to load sass to support both http and https?
Thanks!
Hi,
What does your baseURL
config look like?
zwbetz
October 21, 2019, 9:43am
3
In addition to what @pointyfar asked:
Instead of
$style.Permalink
Use
$style.RelPermalink
alups
October 22, 2019, 1:29am
4
Thanks @zwbetz and @pointyfar :
According to your notice, I solved the problem.
Initially when generate public files, my BASEURL in command line like ]
baseURL = http://myname.github.com
<link rel="stylesheet" href="{{ $style.Permalink }}">
but default github use https, so it complain that I also have a http and https to connection to the same site simultaneously.
I tried to change baseURL = https/myname.github.com/ in command line, it works well.
but I think $style.RelPermalink is more safe, because it works in both way.
Thanks Again !