<!-- HTTPS -->

<script type="text/javascript">
    var baseURL = '{{ .Site.BaseURL }}';
    var host = baseURL.substring(0, baseURL.length - 1).replace(/\//g, '');
    if ((host === window.location.host) && (window.location.protocol !== 'https:')) {
        window.location.protocol = 'https:';
    }
</script>

<!-- CSS -->

{{ if .Site.Params.highlightjs }}
  <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.8.0/styles/default.min.css">
{{ end }}

<link rel="stylesheet" href="/css/reset.css">
<link rel="stylesheet" href="/css/pygments.css">
<link rel="stylesheet" href="/css/main.css">

{{range .Site.Params.extracssfiles}}
    <link rel="stylesheet" href="{{.}}">
{{end}}

<!-- Icon -->
<link rel="shortcut icon"
{{ if .Site.Params.faviconfile }}
    href="/{{ .Site.Params.faviconfile | absURL }}"
{{ else }}
    href="/img/favicon.ico"
{{ end }}
>

<!-- RSS -->
{{ if .RSSLink }}
  <link href="{{ .RSSLink }}" rel="alternate" type="application/rss+xml" title="{{ .Site.Title }}" />
{{ end }}

<!--[if lt IE 9]>
    <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->

<!-- HTTPS -->

<script type="text/javascript">
    var baseURL = '{{ .Site.BaseURL }}';
    var host = baseURL.substring(0, baseURL.length - 1).replace(/\//g, '');
    if ((host === window.location.host) && (window.location.protocol !== 'https:')) {
        window.location.protocol = 'https:';
    }
</script>

<!-- CSS -->

{{ if .Site.Params.highlightjs }}
  <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.8.0/styles/default.min.css">
{{ end }}

<link rel="stylesheet" href="{{ .Site.BaseURL }}/css/reset.css">
<link rel="stylesheet" href="{{ .Site.BaseURL }}/css/pygments.css">
<link rel="stylesheet" href="{{ .Site.BaseURL }}/css/main.css">

{{range .Site.Params.extracssfiles}}
    <link rel="stylesheet" href="{{.}}">
{{end}}

<!-- Icon -->
<link rel="shortcut icon"
{{ if .Site.Params.faviconfile }}
    href="{{ .Site.Params.faviconfile | absURL }}"
{{ else }}
    href="{{ .Site.BaseURL }}/img/favicon.ico"
{{ end }}
>

<!-- RSS -->
{{ if .RSSLink }}
  <link href="{{ .RSSLink }}" rel="alternate" type="application/rss+xml" title="{{ .Site.Title }}" />
{{ end }}

<!--[if lt IE 9]>
    <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->

Add more correct path with BaseURL
Add more correct path with BaseURL

