fix: use get_featured_image partial consistently for og:image and JSON-LD#3311
fix: use get_featured_image partial consistently for og:image and JSON-LD#3311chezou wants to merge 1 commit intoHugoBlox:mainfrom
Conversation
โฆN-LD site_head.html, jsonld/article.html, jsonld/qapage.html, and jsonld/event.html hardcode `(.Resources.ByType "image").GetMatch "*featured*"` to find featured images. This ignores custom filenames set via `.Params.image.filename` in front matter, causing og:image and JSON-LD image to fall back to the site icon. Replace the hardcoded pattern with the `get_featured_image` partial (already used by jsonld/webpage.html), which properly searches for: 1. Files matching `*featured*` in the page directory 2. Custom filename from `.Params.image.filename` in the page directory 3. Custom filename in `assets/media/` directory Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
โ Deploy Preview for academic-demo canceled.
|
|
Wow, your first PR! Welcome to the community! ๐ Thank you for this contribution to open source and open research. It makes a huge impact for the thousands of innovators building with Hugo Blox. If you're wondering about next steps, please read our Contributor Guide for coding standards, how to run the project locally, and how to get help. We hope this is just the start of your journey with us. Let's build the future together! Join us on Discord to connect with the team and community. Awesome work, we'll take a look soon! โจ |
|
Per Github Copilot with GPT-5.4, the CI failures are unrelated with my change. Here is the brief analysis by GPT-5.4: |
๐ What type of change is this?
๐ฏ What is the purpose of this change?
site_head.html, jsonld/article.html, jsonld/qapage.html, and jsonld/event.html hardcode
(.Resources.ByType "image").GetMatch "*featured*"to find featured images. This ignores custom filenames set via.Params.image.filenamein front matter, causing og:image and JSON-LD image to fall back to the site icon.Replace the hardcoded pattern with the
get_featured_imagepartial (already used by jsonld/webpage.html), which properly searches for:*featured*in the page directory.Params.image.filenamein the page directoryassets/media/directory๐ธ Screenshots or Screencast (if applicable)
Before:
After:
(URL in the post: https://chezo.uno/post/2026-03-28-montreal%E3%81%AB10%E5%B9%B4%E4%BB%A5%E4%B8%8A%E3%81%B5%E3%82%8A%E3%81%AB%E8%A1%8C%E3%81%A3%E3%81%9F/ )
โน๏ธ Documentation Check
๐ Contributor Agreement
Thank you for your contribution!