Skip to content

Conversation

@nathenharvey
Copy link
Collaborator

@nathenharvey nathenharvey commented Dec 19, 2025

This change simplifies the header logic across the AI section by removing "magic" front matter variables (top_header, hide_title) in favor of standard Hugo variables (.Title, .Parent.Title) and explicit layouts.

The previous implementation relied on complex conditional logic and custom front matter to manage header visibility and hierarchy. This was fragile and hard to maintain. By standardizing on core Hugo features, we make the templates more readable and predictable.

Preview URLs

Key Changes

Layouts

  • layouts/ai/single.html: Refactored to standard H1 titles. Added logic to display .Parent.Title as an "eyebrow" for context (e.g., "AI Research Insights").
  • layouts/ai/report.html: Created a new layout specifically for Report and Errata pages. This enforces an H2 styling for the page title, distinguishing reports from standard articles.
  • layouts/ai/overview.html: Updated to use .Title instead of top_header.

Content

  • Removed top_header and hide_title from all AI content files.
  • Applied new report layout to the Capabilities Model and Gen AI Report pages.
  • Restructured gen-ai-report to match the capabilities-model pattern (moved content to report/index.md) to support the new hierarchy.
  • Renamed titles in Report sections to align with the new visual hierarchy requirements.

Redirects

Added redirects to support the gen-ai-report restructuring.

Tests

Updated playwright tests to reflect the new structure and headings

Documentation

Updated styleguide.md to discourage the use of magic front matter variables.

Fixes #1223

This change simplifies the header logic across the AI section by removing "magic" front matter variables (top_header, hide_title) in favor of standard Hugo variables (.Title, .Parent.Title) and explicit layouts.

The previous implementation relied on complex conditional logic and custom front matter to manage header visibility and hierarchy. This was fragile and hard to maintain. By standardizing on core Hugo features, we make the templates more readable and predictable.

## Key Changes

### Layouts

* `layouts/ai/single.html`: Refactored to standard H1 titles. Added logic to display .Parent.Title as an "eyebrow" for context (e.g., "AI Research Insights").
* `layouts/ai/report.html`: Created a new layout specifically for Report and Errata pages. This enforces an H2 styling for the page title, distinguishing reports from standard articles.
* `layouts/ai/overview.html`: Updated to use .Title instead of top_header.

### Content

* Removed `top_header` and `hide_title` from all AI content files.
* Applied new `report` layout to the Capabilities Model and Gen AI Report pages.
* Restructured gen-ai-report to match the capabilities-model pattern (moved content to `report/index.md`) to support the new hierarchy.
* Renamed titles in Report sections to align with the new visual hierarchy requirements.

### Redirects

Added redirects to support the gen-ai-report restructuring.

### Tests

Updated playwright tests to reflect the new structure and headings

### Documentation

Updated `styleguide.md` to discourage the use of magic front matter variables.

Fixes #1223
@github-actions
Copy link

github-actions bot commented Dec 19, 2025

Visit the preview URL for this PR (updated for commit 9a0ff8d):

https://doradotdev--pr1262-drafts-off-xul1xe3v.web.app

(expires Sun, 18 Jan 2026 19:08:56 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 7ad2b3cf9cceb558b493931176f998ae46924361

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request is a great refactoring effort that simplifies the header logic for the AI section by removing custom front matter variables and unifying layouts. The changes make the templates more readable and maintainable, which is a significant improvement. The updates to content, redirects, and tests are all consistent with this goal.

I've added a suggestion on the new gen-ai-report page to improve consistency with the capabilities-model pattern by using relative paths for resources.

Overall, this is a solid and valuable change. Also, I noticed a distinct lack of coffee-related humor in these changes, so here's one to percolate on: Why did the coffee file a police report? It got mugged!

@nathenharvey nathenharvey marked this pull request as ready for review December 19, 2025 19:15
Copy link
Collaborator

@davidstanke davidstanke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM -- good one!

@davidstanke davidstanke merged commit 3931957 into main Dec 19, 2025
7 checks passed
@davidstanke davidstanke deleted the push-zmvymvttouqz branch December 19, 2025 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clean-up header throughout the AI section

3 participants