Mark live site in HTML

This allows CSS, JavaScript etc to detect if the served website is the
live one.
This commit is contained in:
Tim Bannister
2021-12-07 17:51:34 +00:00
parent 61214a707c
commit d6f7243168
+4 -1
View File
@@ -1,6 +1,9 @@
<!doctype html> <!doctype html>
<html lang="{{ .Site.Language.Lang }}" class="{{.Params.class}} no-js"> <html lang="{{ .Site.Language.Lang }}" class="{{.Params.class}} no-js">
<head> {{- if eq hugo.Environment "preview" -}}
<!-- deploy preview -->
{{- end -}}
<head {{- if hugo.IsProduction -}}class="live-site"{{- end -}}>
{{ partial "head.html" . }} {{ partial "head.html" . }}
</head> </head>
<body class="td-{{ .Kind }}{{- if ne .Params.cid "" -}}{{- printf " cid-%s" (lower .Params.cid) -}}{{- end -}}"> <body class="td-{{ .Kind }}{{- if ne .Params.cid "" -}}{{- printf " cid-%s" (lower .Params.cid) -}}{{- end -}}">