make disqus use https, force https when sites like github don't do it automatically. Add favorite icon load from /images

master
David Kebler 2017-04-22 20:56:30 -07:00
parent 2588a27126
commit cf1caf2676
3 changed files with 15 additions and 4 deletions

View File

@ -1,6 +1,7 @@
<!-- icon fonts -->
<link href="https://cdn.jsdelivr.net/fontawesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<!-- favorite icon -->
<link rel="shortcut icon" href="/images/favicon.ico" type="image/x-icon" />
<!-- base font -->
<link href="//fonts.googleapis.com/css?family=Roboto" rel="stylesheet" type="text/css">
<!-- monospaced for code -->

View File

@ -5,3 +5,13 @@
<meta name="author" content="">
<meta http-equiv="Cache-Control" content="max-age= {{ .Params.cache_timeout | default "3600"}}" />
<base href="{{ .Site.BaseURL }}">
<!-- force https if turned on. Do this early in the head -->
{{ if isset .Site.Params "force_https" }}
<script>
if (!(window.location.host.startsWith("127.0.0.1") || window.location.host.startsWith("localhost")) && (window.location.protocol != "https:")) {
window.location.protocol = "https";
document.location = "https:" + window.location.href.substring(window.location.protocol.length, window.location.href.length);
}
</script>
{{ end }}

View File

@ -13,14 +13,14 @@
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
var disqus_shortname = '{{ .Get 0 | default .Site.DisqusShortname }}';
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
dsq.src = 'https://' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
<a href="http://disqus.com/" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
<a href="https://disqus.com/" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
<!-- from disqus