feat: use relative urls

This commit is contained in:
Henk Verlinde 2021-09-03 13:49:33 +02:00
parent 559b661847
commit 81db72c98e
4 changed files with 10 additions and 7 deletions

View File

@ -1,4 +1,4 @@
baseurl = "/" baseurl = "https://doks.netlify.app/"
canonifyURLs = false canonifyURLs = false
disableAliases = true disableAliases = true
disableHugoGeneratorInject = true disableHugoGeneratorInject = true
@ -42,6 +42,11 @@ isPlainText = true
noUgly = true noUgly = true
rel = "sitemap" rel = "sitemap"
[caches]
[caches.getjson]
dir = ":cacheDir/:project"
maxAge = "10s"
[markup] [markup]
[markup.goldmark] [markup.goldmark]
[markup.goldmark.extensions] [markup.goldmark.extensions]

View File

@ -1,2 +1 @@
baseurl = "https://doks-next.netlify.app/" canonifyURLs = false
canonifyURLs = true

View File

@ -1,2 +1 @@
baseurl = "https://doks.netlify.app/" canonifyURLs = false
canonifyURLs = true

View File

@ -1,11 +1,11 @@
{{ if eq (hugo.Environment) "development" -}} {{ if eq (hugo.Environment) "development" -}}
{{ $options := (dict "targetPath" "main.css" "enableSourceMap" true "includePaths" (slice "node_modules")) -}} {{ $options := (dict "targetPath" "main.css" "enableSourceMap" true "includePaths" (slice "node_modules")) -}}
{{ $css := resources.Get "scss/app.scss" | toCSS $options -}} {{ $css := resources.Get "scss/app.scss" | toCSS $options -}}
<link rel="stylesheet" href="{{ $css.Permalink }}"> <link rel="stylesheet" href="{{ $css.Permalink | relURL }}">
{{ else -}} {{ else -}}
{{ $options := (dict "targetPath" "main.css" "outputStyle" "compressed" "includePaths" (slice "node_modules")) -}} {{ $options := (dict "targetPath" "main.css" "outputStyle" "compressed" "includePaths" (slice "node_modules")) -}}
{{ $css := resources.Get "scss/app.scss" | toCSS $options | postCSS (dict "config" "config/postcss.config.js") -}} {{ $css := resources.Get "scss/app.scss" | toCSS $options | postCSS (dict "config" "config/postcss.config.js") -}}
{{ $secureCSS := $css | resources.Fingerprint "sha512" -}} {{ $secureCSS := $css | resources.Fingerprint "sha512" -}}
<link rel="stylesheet" href="{{ $secureCSS.Permalink }}" integrity="{{ $secureCSS.Data.Integrity }}" crossorigin="anonymous"> <link rel="stylesheet" href="{{ $secureCSS.Permalink | relURL }}" integrity="{{ $secureCSS.Data.Integrity }}" crossorigin="anonymous">
{{ end -}} {{ end -}}
<noscript><style>img.lazyload { display: none; }</style></noscript> <noscript><style>img.lazyload { display: none; }</style></noscript>