Skip to content

Conversation

@asafashirov
Copy link
Contributor

Summary

  • Implements Hugo's cascade feature to provide a default social card image for all documentation pages
  • Adds cascade: meta_image configuration to /content/docs/_index.md
  • Ensures proper social media previews for 371+ docs pages currently missing custom meta images

Problem

Many documentation pages were missing social card images, causing them to fall back to the generic Pulumi logo when shared on social media platforms like Twitter/X. This resulted in less professional and less informative social previews for documentation content.

Solution

Using Hugo's native cascade feature, all documentation pages now automatically inherit the docs-branded social card image (/images/docs/meta-images/docs-meta.png) unless they have a custom meta_image explicitly set in their frontmatter.

Benefits

  • Immediate coverage: All 371+ docs pages without explicit meta_image now have proper social cards
  • Future-proof: New documentation pages automatically get appropriate social cards
  • Maintains flexibility: Pages with custom meta_image values retain their specific images
  • Clean implementation: Uses Hugo's intended feature for section defaults, no template hacks needed

Testing

Verified locally that:

  • ✅ Docs pages without meta_image now correctly show the docs-branded social card
  • ✅ Pages with existing meta_image continue to use their custom images
  • ✅ Non-docs sections (blog, homepage) are unaffected

Technical Details

The cascade feature works by setting default frontmatter values that are inherited by all descendant pages in the /docs/ section. This is the Hugo-idiomatic way to handle section-level defaults.

Example of the improved social preview: Instead of showing the generic Pulumi logo, docs pages will now display the dedicated docs meta image when shared on social media.

Implements Hugo cascade to provide a default social card image for all documentation pages that don't have an explicit meta_image set. This ensures proper social media previews for the 371+ docs pages currently missing custom meta images.

- Uses Hugo's native cascade feature for clean inheritance
- Pages with existing meta_image values retain their custom images
- All docs pages now display docs-branded social card by default
- No template modifications required
@claude
Copy link
Contributor

claude bot commented Oct 6, 2025

Review Summary

This PR correctly implements Hugo's cascade feature to provide a default social card image for documentation pages. The implementation is clean and follows Hugo best practices.

✅ Strengths

  • Correct implementation: Hugo cascade syntax is properly used and will inherit to all descendant pages under /docs/
  • Image file exists: Verified that /static/images/docs/meta-images/docs-meta.png exists
  • No conflicts: Pages with existing meta_image values will retain their custom images (including /docs/esc/_index.md and /docs/iac/_index.md)
  • Clean approach: Uses Hugo's native feature rather than template workarounds

Issues Found

1. Inaccurate claim in PR description

The PR states "All 371+ docs pages without explicit meta_image now have proper social cards", but the actual numbers are:

  • Total doc pages: 697
  • Pages with explicit meta_image: 327
  • Pages that will benefit from cascade: ~370

The number is approximately correct, but worth noting for accuracy.

2. Redundant meta_image in parent (Line 5, 17)

The file content/docs/_index.md now has meta_image defined in TWO places:

  • Line 5: meta_image: /images/docs/meta-images/docs-meta.png
  • Lines 16-17: cascade with meta_image: /images/docs/meta-images/docs-meta.png

Recommendation: Remove line 5 since the cascade on lines 16-17 will handle it. This eliminates duplication and makes the intent clearer.

Verification

✅ File ends with newline
✅ YAML syntax is correct
✅ Follows repository conventions
✅ No style guide violations
✅ Referenced image file exists

Suggested Fix

Remove the redundant meta_image from line 5 to avoid duplication. The cascade will apply the meta_image to both the _index.md page itself and all descendant pages.

This is a minor improvement—the PR works correctly as-is.

@pulumi-bot
Copy link
Collaborator

@asafashirov asafashirov requested a review from dirien October 6, 2025 15:19
Copy link
Contributor

@dirien dirien left a comment

Choose a reason for hiding this comment

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

LGTM!

@dirien
Copy link
Contributor

dirien commented Oct 6, 2025

@asafashirov is this the default image?

image

@asafashirov
Copy link
Contributor Author

@dirien no, it's:
image

@dirien
Copy link
Contributor

dirien commented Oct 6, 2025

@asafashirov nice! Love it! Go and merge as u please!

@asafashirov asafashirov merged commit 09a157b into master Oct 6, 2025
12 checks passed
@asafashirov asafashirov deleted the add-docs-default-social-card branch October 6, 2025 16:10
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.

4 participants