Fixes #88 + refactoring of head.html

This commit is contained in:
Panos Sakkos 2015-11-20 17:45:52 +01:00
parent 0923585986
commit f1bf70cb10
7 changed files with 55 additions and 32 deletions

View file

@ -0,0 +1,13 @@
{% if site.force-https %}
<!-- Force HTTPS Start -->
<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>
<!-- Force HTTPS End -->
{% endif %}

View file

@ -2,13 +2,7 @@
<!-- HEAD Start -->
<head>
{% 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 %}
{% include force-https.html %}
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
@ -46,21 +40,9 @@
<meta http-equiv="refresh" content="20; url={{site.baseurl}}/">
{% endif %}
{% if site.web-app-mode %}
{% include web-app.html %}
<!-- Android Web App mode -->
<link rel="manifest" href="{{site.baseurl}}/manifest.json">
{% endif %}
{% if site.syntax-highlight and page.section-type == "post"%}
<!-- Syntax highlight in post pages -->
<link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.2/styles/monokai_sublime.min.css">
{% endif %}
{% include syntax-highlight.html %}
</head>

View file

@ -0,0 +1,8 @@
{% if site.syntax-highlight and page.section-type == "post"%}
<!-- Syntax highlight in post pages -->
<link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.2/styles/monokai_sublime.min.css">
{% endif %}

18
_includes/web-app.html Normal file
View file

@ -0,0 +1,18 @@
{% if site.web-app-mode %}
<!-- iOS Web App mode -->
<meta name="apple-mobile-web-app-capable" content="yes">
<link rel="apple-touch-icon" sizes="36x36" href="{{site.baseurl}}{{site.icon-36p}}">
<link rel="apple-touch-icon" sizes="48x48" href="{{site.baseurl}}{{site.icon-48p}}">
<link rel="apple-touch-icon" sizes="72x72" href="{{site.baseurl}}{{site.icon-72p}}">
<link rel="apple-touch-icon" sizes="96x96" href="{{site.baseurl}}{{site.icon-96p}}">
<link rel="apple-touch-icon" sizes="144x144" href="{{site.baseurl}}{{site.icon-144p}}">
<link rel="apple-touch-icon" sizes="192x192" href="{{site.baseurl}}{{site.icon-192p}}">
<!-- Android Web App mode -->
<link rel="manifest" href="{{site.baseurl}}/manifest.json">
{% endif %}