Skip to content

Commit 43f2b74

Browse files
CopilotThomasPe
andauthored
Add privacy-preserving generator meta tag for theme discoverability (#93)
* Initial plan * Add privacy-preserving generator meta tag for theme discoverability Co-authored-by: ThomasPe <4225039+ThomasPe@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: ThomasPe <4225039+ThomasPe@users.noreply.github.com>
1 parent b87e9dd commit 43f2b74

4 files changed

Lines changed: 41 additions & 0 deletions

File tree

docs/guides/feature-configuration.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,3 +135,31 @@ additional features (e.g., filtering).
135135

136136
- `trackCategoryTitle`: Name of the category used for the session tracks
137137
(default: `Track`).
138+
139+
## Theme discoverability
140+
141+
The Event theme includes a **privacy-preserving discoverability marker**: a
142+
`<meta name="generator" content="hugo-theme-event">` tag in every rendered
143+
page. This allows maintainers (and anyone else) to discover sites using this
144+
theme through simple search-engine queries — without any telemetry, cookies,
145+
tracking IDs, or background requests to remote servers.
146+
147+
### Privacy implications
148+
149+
- The tag is a static, deterministic string embedded in publicly visible HTML.
150+
- No data is ever sent to the theme maintainers or any third party as a result
151+
of this tag.
152+
- Discovery happens entirely through publicly indexed content; your visitors'
153+
privacy is not affected.
154+
155+
### Opting out
156+
157+
If you prefer not to include the discoverability marker, set `disableGenerator`
158+
to `true` in your theme parameters:
159+
160+
```yaml
161+
params:
162+
themes:
163+
event:
164+
disableGenerator: true
165+
```

hugo.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,3 +122,7 @@ params:
122122
# 👇 based on their browser preferences (requires JavaScript).
123123
# 👇 Set to false to disable (e.g., for demos, testing, or non-JS environments).
124124
redirectBasedOnBrowserLang: false
125+
# 👇 Controls whether a <meta name="generator"> tag is included in rendered HTML.
126+
# 👇 This tag allows the theme to be discovered via search-engine queries without
127+
# 👇 any telemetry, cookies, or remote beacons. Set to true to opt out.
128+
disableGenerator: false

layouts/_default/baseof.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@
6868

6969
<meta name="description" content="{{ .Site.Params.themes.event.description | markdownify | plainify }}" />
7070

71+
{{ if not .Site.Params.themes.event.disableGenerator }}<meta name="generator" content="hugo-theme-event" />{{ end }}
72+
7173
{{ if .IsTranslated }}
7274
{{ range .Translations }}
7375
<link rel="alternate" hreflang="{{ .Language.Lang }}" href="{{ .Permalink }}" />

tests/baseof.spec.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,10 @@ test('should not render language selector with one language', async ({ page }) =
2424
const languageSelector = page.locator('[data-testid="language-select"]');
2525
await expect(languageSelector).toHaveCount(0);
2626
});
27+
28+
test('Should render generator meta tag by default', async ({ page }) => {
29+
await page.goto('/');
30+
31+
const generator = page.locator('meta[name="generator"][content="hugo-theme-event"]');
32+
await expect(generator).toHaveCount(1);
33+
});

0 commit comments

Comments
 (0)