diff options
author | Geraint Corneu <5abeea96+gitlab@posteo.org> | 2017-09-03 03:01:58 +0300 |
---|---|---|
committer | Geraint Corneu <5abeea96+gitlab@posteo.org> | 2017-09-03 03:01:58 +0300 |
commit | a39bf83e7ed57b1b43dd0bcc5491447176f5e02f (patch) | |
tree | 115a5a23cf6c5c33bc8b199574d26950b27182d0 | |
parent | f665b3702dec1715cd2e1d86767a1e2308cf5d15 (diff) |
Use relative URLs for assets and images
-rw-r--r-- | layouts/index.html | 2 | ||||
-rw-r--r-- | layouts/partials/header.html | 22 |
2 files changed, 12 insertions, 12 deletions
diff --git a/layouts/index.html b/layouts/index.html index 6007297..fd64ec8 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -23,7 +23,7 @@ <!-- Main --> <section id="main"> <header> - <span class="avatar"><img src="/images/avatars/{{ .Site.Params.personal.avatar }}" alt="avatar" height="130" width="130" ></span> + <span class="avatar"><img src="{{ .Site.Params.personal.avatar | printf "/images/avatars/%s" | relURL }}" alt="avatar" height="130" width="130" ></span> <h1 class="name"> {{ with .Site.Params.personal.name }} {{ . }} diff --git a/layouts/partials/header.html b/layouts/partials/header.html index cc8441c..3e6e9f6 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -6,33 +6,33 @@ <meta name="author" content="{{ with .Site.Params.name }}{{ . }}{{ end }}"> {{ .Hugo.Generator }} {{ if .Site.Params.favicon_ico }} - <link rel="icon" href="/images/icons/{{ .Site.Params.favicon_ico }}" type="image/x-icon" {{ if .Site.Params.favicon_ico_sizes }}sizes="{{ .Site.Params.favicon_ico_sizes }}"{{ end }} /> + <link rel="icon" href="{{ .Site.Params.favicon_ico | printf "/images/icons/%s" | relURL }}" type="image/x-icon" {{ if .Site.Params.favicon_ico_sizes }}sizes="{{ .Site.Params.favicon_ico_sizes }}"{{ end }} /> {{ end }} {{ if .Site.Params.favicon_png }} - <link rel="icon" href="/images/icons/{{ .Site.Params.favicon_png }}" type="image/png" {{ if .Site.Params.favicon_png_sizes }}sizes="{{ .Site.Params.favicon_png_sizes }}"{{ end }} /> + <link rel="icon" href="{{ .Site.Params.favicon_png | printf "/images/icons/%s" | relURL }}" type="image/png" {{ if .Site.Params.favicon_png_sizes }}sizes="{{ .Site.Params.favicon_png_sizes }}"{{ end }} /> {{ end }} {{ if .Site.Params.favicon_svg }} - <link rel="icon" href="/images/icons/{{ .Site.Params.favicon_svg }}" type="image/svg+xml" sizes="any" /> + <link rel="icon" href="{{ .Site.Params.favicon_svg | printf "/images/icons/%s" | relURL }}" type="image/svg+xml" sizes="any" /> {{ end }} - <link rel="apple-touch-icon-precomposed" href="/images/icons/{{ .Site.Params.appleicon }}" /> + <link rel="apple-touch-icon-precomposed" href="{{ .Site.Params.appleicon | printf "/images/icons/%s" | relURL }}" /> - <link rel="stylesheet" href="/assets/css/main.css" /> + <link rel="stylesheet" href="{{ "/assets/css/main.css" | relURL }}" /> {{ if not .Site.Params.custom_background }} - <link rel="stylesheet" href="/assets/css/page.css" /> + <link rel="stylesheet" href="{{ "/assets/css/page.css" | relURL }}" /> {{ end }} {{ if not .Site.Params.custom_icons }} - <link rel="stylesheet" href="/assets/css/font-awesome.min.css" /> + <link rel="stylesheet" href="{{ "/assets/css/font-awesome.min.css" | relURL }}" /> {{ end }} {{ range .Site.Params.custom_css }} <link rel="stylesheet" href="{{ . | absURL }}"> {{ end }} - <!--[if lte IE 8]><script src="/assets/js/html5shiv.js"></script><![endif]--> - <!--[if lte IE 8]><link rel="stylesheet" href="/assets/css/ie8.css" /><![endif]--> - <!--[if lte IE 9]><link rel="stylesheet" href="/assets/css/ie9.css" /><![endif]--> + <!--[if lte IE 8]><script src="{{ "/assets/js/html5shiv.js" | relURL }}"></script><![endif]--> + <!--[if lte IE 8]><link rel="stylesheet" href="{{ "/assets/css/ie8.css" | relURL }}" /><![endif]--> + <!--[if lte IE 9]><link rel="stylesheet" href="{{ "/assets/css/ie9.css" | relURL }}" /><![endif]--> - <noscript><link rel="stylesheet" href="/assets/css/noscript.css" /></noscript> + <noscript><link rel="stylesheet" href="{{ "/assets/css/noscript.css" | relURL }}" /></noscript> </head> |