Skip to content

Commit 9e8d868

Browse files
committed
wip(web): keep draft site out of search engines via site-wide noindex switch
1 parent 28fbfdb commit 9e8d868

4 files changed

Lines changed: 5 additions & 3 deletions

File tree

web/config.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ ignoreFiles = ['_index\.template\.md$']
2323
author = "author"
2424

2525
[params]
26+
# draft site: keep search engines out — remove before production launch
27+
noindex = true
2628
[params.hubspot]
2729
portalId = "149027957"
2830
formId = "2d7f94a7-acd0-4cbc-8c3e-c39fd1ae14bd"

web/layouts/containers/list.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{{ define "head-seo" }}
2-
<meta name="robots" content="index, follow">
2+
{{ if or site.Params.previewgate site.Params.noindex }}<meta name="robots" content="noindex, nofollow">{{ else }}<meta name="robots" content="index, follow">{{ end }}
33
<link href="{{ "css/bootstrap-grid.min.css" | relURL }}?{{ now.Unix }}" rel="stylesheet">
44
<link href="{{ "css/containers.css" | relURL }}?{{ now.Unix }}" rel="stylesheet">
55
{{ end }}

web/layouts/partials/catalog/seo-meta.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{{- /* head-seo block for catalog pages: canonical + catalog assets + JSON-LD.
22
Single live catalog version → everything is indexable. */ -}}
3-
{{ if not (or site.Params.previewgate site.Params.noindex) }}<meta name="robots" content="index, follow">{{ end }}
3+
{{ if or site.Params.previewgate site.Params.noindex }}<meta name="robots" content="noindex, nofollow">{{ else }}<meta name="robots" content="index, follow">{{ end }}
44
<link rel="canonical" href="{{ .Permalink }}">
55
<link rel="stylesheet" href="{{ "catalog/css/main.css" | relURL }}">
66

web/layouts/robots.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
User-agent: *
2-
{{ if site.Params.previewgate }}Disallow: /{{ else }}Allow: /
2+
{{ if or site.Params.previewgate site.Params.noindex }}Disallow: /{{ else }}Allow: /
33
Sitemap: {{ "sitemap.xml" | absURL }}{{ end }}

0 commit comments

Comments
 (0)