_includes/head.html in phantom-blergh-0.1.4 vs _includes/head.html in phantom-blergh-0.1.5
- old
+ new
@@ -1,36 +1,61 @@
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
- <script type="text/javascript">
- (function() {
- // redirect from http://thelonelyghost.gitlab.io/blog/foo -> https://blog.thelonelyghost.com/foo
- // Someday this will be scripted into something with better hooks into Jekyll
- if(window.location.hostname == 'thelonelyghost.gitlab.io' && (window.location.pathname || '').match(/^\/?blog\/?/i)) {
- var path = (function(pathname) {
- var parts = pathname.split('/');
- while(parts.length > 0 && (parts[0] == '' || parts[0] == 'blog')) parts.shift();
- return parts.length > 0 ? parts.join('/') : '';
- })(window.location.pathname);
- path += window.location.search;
- path += window.location.hash;
- window.location = 'https://blog.thelonelyghost.com/' + path;
- }
- })();
- </script>
{% if site.features.https_only == true %}
- <script type="text/javascript" src="{{ "/assets/js/https.js" | relative_url }}"></script>
+ <script type="text/javascript">
+ (function() {
+ // Detect dev server environments
+ var isDevelopment = window.location.hostname == 'localhost' ||
+ (window.location.hostname || '').match(/\.local$/i) ||
+ window.location.hostname == '127.0.0.1' ||
+ window.location.hostname == '::1';
+
+ // redirect from http://thelonelyghost.gitlab.io/blog/foo -> https://blog.thelonelyghost.com/foo
+ // Someday this will be scripted into something with better hooks into Jekyll
+ if(window.location.hostname == 'thelonelyghost.gitlab.io' && (window.location.pathname || '').match(/^\/?blog\/?/i)) {
+ var path = (function(pathname) {
+ var parts = pathname.split('/');
+ while(parts.length > 0 && (parts[0] == '' || parts[0] == 'blog')) parts.shift();
+ return parts.length > 0 ? parts.join('/') : '';
+ })(window.location.pathname);
+ path += window.location.search;
+ path += window.location.hash;
+ window.location = 'https://blog.thelonelyghost.com/' + path;
+ }
+ // Ensures we're only serving via https, except when localhost development
+ if(window.location.protocol != 'https:' && !isDevelopment)
+ window.location.protocol = 'https:';
+ })();
+ </script>
+ {% else %}
+ <script type="text/javascript">
+ (function() {
+ // redirect from http://thelonelyghost.gitlab.io/blog/foo -> https://blog.thelonelyghost.com/foo
+ // Someday this will be scripted into something with better hooks into Jekyll
+ if(window.location.hostname == 'thelonelyghost.gitlab.io' && (window.location.pathname || '').match(/^\/?blog\/?/i)) {
+ var path = (function(pathname) {
+ var parts = pathname.split('/');
+ while(parts.length > 0 && (parts[0] == '' || parts[0] == 'blog')) parts.shift();
+ return parts.length > 0 ? parts.join('/') : '';
+ })(window.location.pathname);
+ path += window.location.search;
+ path += window.location.hash;
+ window.location = 'https://blog.thelonelyghost.com/' + path;
+ }
+ })();
+ </script>
{% endif %}
<title>{% if page.title %}{{ page.title | escape }}{% else %}{{ site.title | escape }}{% endif %}</title>
<meta name="description" content="{{ page.excerpt | default: site.description | strip_html | normalize_whitespace | truncate: 160 | escape }}" />
{% include twitter-card-meta.html %}
{% include opengraph-meta.html %}
{% include indie-web-signin.html %}
- <link rel="stylesheet" href="{{ "/assets/favicon.png" | relative_url }}" />
+ <link rel="icon" href="{{ "/assets/favicon.png" | relative_url }}" />
<link rel="stylesheet" href="{{ "/assets/css/main.css" | relative_url }}" />
<!--[if lte IE 9]><link rel="stylesheet" href="{{ "/assets/css/ie9.css" | relative_url }}" /><![endif]-->
<link rel="canonical" href="{{ page.url | replace:'index.html','' | absolute_url }}" />
<link rel="alternate" type="application/rss+xml" title="{{ site.title | escape }}" href="{{ "/feed.xml" | relative_url }}" />