Skip to content

Commit 4592cf5

Browse files
author
Tim Bannister
committed
Mark live site in HTML
This allows CSS, JavaScript etc to detect if the served website is the live one.
1 parent 2dfe0d1 commit 4592cf5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

layouts/_default/baseof.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
<!doctype html>
22
<html lang="{{ .Site.Language.Lang }}" class="{{.Params.class}} no-js">
3-
<head>
3+
{{- if eq hugo.Environment "preview" -}}
4+
<!-- deploy preview -->
5+
{{- end -}}
6+
<head {{- if hugo.IsProduction -}}class="live-site"{{- end -}}>
47
{{ partial "head.html" . }}
58
</head>
69
<body class="td-{{ .Kind }}{{- if ne (lower .Params.cid) "" -}}{{- printf " cid-%s" (lower .Params.cid) -}}{{- end -}}">

0 commit comments

Comments
 (0)