added option to redirect to baseurl
This commit is contained in:
parent
9566d4e75f
commit
f2e2af6f92
|
@ -73,6 +73,11 @@ paginate = 5 # number of articles per page in the index
|
||||||
dimForegroundColor = "#bababa"
|
dimForegroundColor = "#bababa"
|
||||||
strokeColor = "#4f4f4f"
|
strokeColor = "#4f4f4f"
|
||||||
accentColor = "#db5793"
|
accentColor = "#db5793"
|
||||||
|
|
||||||
|
# redirect to baseURL if current URL host doesn't match
|
||||||
|
# useful if deploying in gitlab pages with custom domain and don't want
|
||||||
|
# the username.gitlab.io/website url to persist
|
||||||
|
forceRedirect = false
|
||||||
```
|
```
|
||||||
|
|
||||||
## Inject custom content
|
## Inject custom content
|
||||||
|
|
|
@ -1,4 +1,9 @@
|
||||||
<head>
|
<head>
|
||||||
|
{{ if .Site.Params.forceRedirect }}
|
||||||
|
<script>
|
||||||
|
if (location.host != new URL("{{ .Site.BaseURL }}").host) location.href = "{{ .Site.BaseURL }}"
|
||||||
|
</script>
|
||||||
|
{{ end }}
|
||||||
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
|
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
|
||||||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
|
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=7">
|
<meta http-equiv="X-UA-Compatible" content="IE=7">
|
||||||
|
|
Loading…
Reference in New Issue