Force https
This commit is contained in:
parent
8b0d926494
commit
b8e2a444d8
2 changed files with 11 additions and 0 deletions
|
|
@ -12,6 +12,10 @@ baseurl: /personal-jekyll-theme
|
||||||
|
|
||||||
google-tracking-id: "<YOUR GOOGLE TRACKING ID>"
|
google-tracking-id: "<YOUR GOOGLE TRACKING ID>"
|
||||||
|
|
||||||
|
# Forces https everywhere in your website, except when you serve it locally
|
||||||
|
|
||||||
|
force-https: True
|
||||||
|
|
||||||
#############
|
#############
|
||||||
# HTML Head #
|
# HTML Head #
|
||||||
#############
|
#############
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,13 @@
|
||||||
{% if site.favicon %}
|
{% if site.favicon %}
|
||||||
<link rel="shortcut icon" type="image/x-icon" href="{{site.baseurl}}{{ site.favicon }}">
|
<link rel="shortcut icon" type="image/x-icon" href="{{site.baseurl}}{{ site.favicon }}">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if site.force-https %}
|
||||||
|
<script>
|
||||||
|
// Don't force http when serving the website locally
|
||||||
|
if (!(window.location.host.startsWith("127.0.0.1")) && (window.location.protocol != "https:"))
|
||||||
|
window.location.protocol = "https";
|
||||||
|
</script>
|
||||||
|
{% endif %}
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<!-- HEAD End -->
|
<!-- HEAD End -->
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue