summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornanxiaobei <nanxiaobei@gmail.com>2019-06-10 06:44:15 +0800
committernanxiaobei <nanxiaobei@gmail.com>2019-06-10 06:44:15 +0800
commit67767c62c241c20f563801f1d49979645d61ef8b (patch)
treec5a4a319c1dcc5addd1d740ed35a7ab6b70f60fa
parentd9093afb2d1151811f2e14c68eadd3c76e11b7de (diff)
Change `.Site.BaseURL` to `absURL`
-rw-r--r--layouts/_default/single.html2
-rw-r--r--layouts/partials/header.html14
2 files changed, 8 insertions, 8 deletions
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index c69e4c3..b54adaa 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -14,7 +14,7 @@
{{ if .Params.tags }}
<ul class="post-tags">
{{ range .Params.tags }}
- <li><a href="{{$.Site.BaseURL}}tags/{{ . | urlize }}/">{{ . }}</a></li>
+ <li><a href="{{ "tags/" | absURL }}{{ . | urlize }}/">{{ . }}</a></li>
{{ end }}
</ul>
{{ end }}
diff --git a/layouts/partials/header.html b/layouts/partials/header.html
index 1c82e77..b7784a6 100644
--- a/layouts/partials/header.html
+++ b/layouts/partials/header.html
@@ -22,15 +22,15 @@
<meta name="author" content="{{ .Site.Params.author }}">
{{ end -}}
<!-- Styles -->
- <link href="{{.Site.BaseURL}}css/github-gist.min.css" rel="stylesheet">
- <link href="{{.Site.BaseURL}}css/style.css" rel="stylesheet">
+ <link href="{{ "css/github-gist.min.css" | absURL }}" rel="stylesheet">
+ <link href="{{ "css/style.css" | absURL }}" rel="stylesheet">
<!-- Favicons -->
- <link rel="apple-touch-icon" href="{{.Site.BaseURL}}img/apple-touch-icon.png">
- <link rel="icon" href="{{.Site.BaseURL}}img/favicon.ico">
+ <link rel="apple-touch-icon" href="{{ "img/apple-touch-icon.png" | absURL }}">
+ <link rel="icon" href="{{ "img/favicon.ico" | absURL }}">
<!-- Generator -->
{{ .Hugo.Generator }}
<!-- RSS -->
- <link rel="alternate" type="application/atom+xml" href="{{.Site.BaseURL}}index.xml" title="{{ .Site.Title }}">
+ <link rel="alternate" type="application/atom+xml" href="{{ "index.xml" | absURL }}" title="{{ .Site.Title }}">
{{ if eq (getenv "HUGO_ENV") "production" | or (eq .Site.Params.env "production") }}
{{ template "_internal/google_analytics_async.html" . }}
{{ end }}
@@ -40,9 +40,9 @@
<header class="header">
<div class="wrap">
{{ if .IsHome }}
- <h1 class="logo"><a href="{{.Site.BaseURL}}">{{ .Site.Title }} </a></h1>
+ <h1 class="logo"><a href="{{ "/" | absURL }}">{{ .Site.Title }} </a></h1>
{{ else }}
- <p class="logo"><a href="{{.Site.BaseURL}}">{{ .Site.Title }} </a></p>
+ <p class="logo"><a href="{{ "/" | absURL }}">{{ .Site.Title }} </a></p>
{{ end }}
<button class="menu-toggle" type="button"></button>
</div>