refactor(layouts): resolve products from data, not hardcoded lists - #7573
Open
jstirnaman wants to merge 2 commits into
Open
refactor(layouts): resolve products from data, not hardcoded lists#7573jstirnaman wants to merge 2 commits into
jstirnaman wants to merge 2 commits into
Conversation
Contributor
Vale Style Check Results
✅ Check passed |
Contributor
Release version checkNo release-notes pages with a tracked version changed in this PR. 💡 Badge new features with the versionDocumenting a new feature? Add a version badge in the page frontmatter — the
For inline version text, use |
jstirnaman
force-pushed
the
refactor-search-labels-from-products
branch
from
July 28, 2026 13:57
0500a53 to
1dd0903
Compare
Five templates inferred a product by parsing the URL path, then branched on hardcoded lists of product and version names. The inference is wrong under /influxdb3/, where the path segment is `influxdb3` but the products.yml keys are `influxdb3_core`, `influxdb3_cloud`, and so on, so the lookup always missed and each template papered over it with its own list. The lists drifted. `header/coveo-meta-data.html` and `header/search-attributes.html` both decided "is this page current", with different lists. InfluxDB 3 Explorer and Telegraf Controller were current for Algolia and stale for Coveo. Resolve the product from the cascade `product` param instead, which every product section already declares. Add product/get-context.html for the lookup and product/is-latest.html for the shared currency rule, so the two search systems cannot disagree again. Move the branching facts into data/products.yml: supports_flux influxdb, influxdb_cloud, enterprise_influxdb search_includes_resources false for the six InfluxDB 3 products has_support_contract false for chronograf, kapacitor Set `latest` on telegraf_controller and telegraf_enterprise to their version path segment, matching every other product. Both had `latest: 1.0` unquoted, which YAML parses as a float and Hugo renders as "1", so the currency check could never match. `latest_patch: 1.0.1` still carries the release version. The search tag stays path-derived. It is the key Algolia indexed every record under, and content_path does not reproduce it for the five products whose content path omits the version segment. No product names remain in the touched templates.
jstirnaman
force-pushed
the
refactor-layouts-product-data
branch
from
July 28, 2026 13:57
ca17b33 to
0bdeeb8
Compare
Templates operate on data and stay ignorant of the values in that data. A product name, version segment, or products.yml key must never appear as a string literal in template logic, so renaming or adding a product never requires a template edit. Document the banned shapes, the three replacements (a per-product field in data/products.yml, product/get-data.html or product/get-context.html for resolution, one shared partial for a decision two templates make), and the incident that motivated it: coveo-meta-data.html and search-attributes.html each kept their own list for the same question, the lists drifted, and InfluxDB 3 Explorer and Telegraf Controller were current for one search system and stale for the other. Carve out one exception. A value that must match an external system rather than a product fact stays as it is, with a comment saying why. The Algolia search tag is path-derived because Algolia indexed every record under the crawled URL, and a well-meaning cleanup would orphan those records. Rule lives in .agents/instructions/layouts.md, how-to in the hugo-template-dev skill, one-line constraint in AGENTS.md. The three adapters are regenerated by yarn build:agent:instructions.
jstirnaman
force-pushed
the
refactor-layouts-product-data
branch
from
July 28, 2026 14:06
0bdeeb8 to
bef595a
Compare
Contributor
🔗 Link Check Results — Link Check Bot✅ All links are valid
|
| Source File | URL | Issue |
|---|---|---|
content/enterprise_influxdb/v1/introduction/installation/single-server/_index.md |
https://support.influxdata.com/ | Network error: SSL certificate not trusted. Use --insecure if site is trusted (e… |
content/influxdb/v1/introduction/install/_index.md |
https://support.influxdata.com/ | Network error: SSL certificate not trusted. Use --insecure if site is trusted (e… |
content/influxdb/v2/install/_index.md |
https://docs.docker.com/engine/reference/run/#detached-vs-foreground | Cannot find fragment: Cannot find fragment |
content/influxdb/v2/install/_index.md |
https://support.influxdata.com/ | Network error: SSL certificate not trusted. Use --insecure if site is trusted (e… |
content/influxdb3/core/install/_index.md |
https://support.influxdata.com/ | Network error: SSL certificate not trusted. Use --insecure if site is trusted (e… |
content/influxdb3/enterprise/install/_index.md |
https://support.influxdata.com/ | Error (cached): Error (cached) |
content/influxdb3/explorer/install/_index.md |
https://support.influxdata.com/ | Network error: SSL certificate not trusted. Use --insecure if site is trusted (e… |
content/telegraf/v1/install/_index.md |
https://support.influxdata.com/ | Error (cached): Error (cached) |
content/telegraf/v1/install/_index.md |
https://docs.microsoft.com/en-us/powershell/scripting/windows-powershell/starting-windows-powershell… | Cannot find fragment: Cannot find fragment |
Full details: workflow run summary and artifact. Last updated: 2026-07-28 14:09:24 UTC
Contributor
📦 PR Preview — Preview Bot
Preview auto-deploys on push. Will be cleaned up when PR closes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #7571, which is stacked on #7569. Review those first; this PR's
base is
refactor-search-labels-from-products.What changed
Five templates stopped inferring the product from the URL path and stopped
branching on hardcoded lists of product names.
Added
layouts/partials/product/get-context.html. It resolves the productfrom the page's cascade
productparam, with a path fallback for producthub pages, which sit above the versioned sections that carry the cascade.
Added
layouts/partials/product/is-latest.html. One rule for "does thispage document the current version", shared by both search systems.
Moved the branching facts into
data/products.yml:supports_fluxsearch_includes_resourcesfalseon the six InfluxDB 3 productshas_support_contractfalseon chronograf, kapacitorSet
latestontelegraf_controllerandtelegraf_enterpriseto theirversion path segment.
Second commit: documented the rule in
.agents/instructions/layouts.md,the
hugo-template-devskill, andAGENTS.md.No product names remain in the touched templates.
Why
header/coveo-meta-data.htmlandheader/search-attributes.htmlbothanswered the same question, each with its own hardcoded list, and the lists
drifted:
Two search systems disagreeing about whether the same page is current.
The lists existed to paper over a broken lookup. Both templates did
index .Site.Data.products $productwhere$productis the first pathsegment. Under
/influxdb3/that segment isinfluxdb3, which is not aproducts.yml key — the keys are
influxdb3_core,influxdb3_cloud. Thelookup always missed, so the real comparison never fired and someone listed
the version segments by hand instead.
The data already answered it.
influxdb3_corehaslatest: core,influxdb3_explorerhaslatest: explorer. Every product section alreadydeclares its products.yml key through cascade, and
layouts/partials/product/get-data.htmlalready resolved it.Impact
Coveo and Algolia now agree on every product. Search tags are unchanged, so
the Algolia index is untouched:
The flux and resources flags reproduce the deleted lists exactly.
Two behavior changes need a second opinion:
telegraf_controllerandtelegraf_enterprisehadlatest: 1.0unquoted. YAML parses that as a float, and Hugo renders it as
"1"— the.0is gone before any regex runs, andeqagainst a string is alwaysfalse. Verified with a Hugo probe:
They are the only two products whose version field is not a string. The
value was dead — no template read
.latestfor either product — but thecurrency rule needs it, so both are now
controllerandenterprise,matching the convention every other product follows:
latestis the URLversion segment,
latest_patchis the release.latest_patch: 1.0.1isunchanged. If release tooling outside this repo reads
telegraf_controller.latestexpecting1.0, say so and I will findanother way.
/platform/and/resources/now mark as current for both systems.Replacing the hardcoded
eq $product "platform"clause with a rule meansstating one: a page outside any versioned product has no older
counterpart. Previously Coveo said stale for both and Algolia said current
for platform only.
Verification
Checked the rendered
public/output for all 16 product sections plus/platform/and/resources/, comparing thelatest,docsearch:latest,docsearch:searchTag,data-search-tag,data-include-flux, anddata-include-resourcesvalues against the pre-refactor build.Note for anyone diffing rendered HTML here: Hugo minifies in production and
drops quotes around attribute names, so
grep '<meta name="latest"'findsnothing. Match
name="?latest"?instead.One exception, deliberate
The Algolia search tag in
header/search-attributes.htmlstays path-derivedand is commented as such. It is the key Algolia indexed all 53,135 records
under, and
content_pathdoes not reproduce it for the five products whosecontent path omits the version segment (telegraf, chronograf, kapacitor,
flux, enterprise_influxdb). The documented rule carries this exception so a
later cleanup does not orphan those records.