layer5 icon indicating copy to clipboard operation
layer5 copied to clipboard

[Hugo] Phase 1 · Decision: images layout (page bundles, a shared folder, or hybrid)

Open saurabhraghuvanshii opened this issue 1 month ago • 6 comments

Parent: #8297 · Open decision: "Images layout"

Facts

  • About 11,200 images: 9,265 SVG, 1,315 WebP, about 600 PNG/JPG/GIF. src/ is 360 MB and static/ is 157 MB.
  • The converter copies 9,431 assets that sit next to collection documents, so most collection images are already bundle-local.
  • 40 front-matter images point outside the bundle (../, src/assets/…): blog 9, resources 27, news 4.
  • Layouts and sections import shared images from src/assets/images (logos, illustrations, icons).
  • Hugo only processes raster images. SVGs are copied as-is, so resizing work applies to about 1,900 files.
  • Blog posts carry thumbnail and darkthumbnail (267 uses), plus thumbnail_svg/darkthumbnail_svg.

Recommendation: hybrid

  • Page bundles for anything owned by one document (what the converter already does).
  • hugo/assets/images/ (processed with resources.Get) for shared images used by layouts, with the same sub-paths as src/assets/images so ports are mechanical.
  • hugo/static/ for files that must keep an exact URL (static/brand, static/press, static/fonts, llms.txt, CNAME-adjacent files).
  • Fix the 40 out-of-bundle references by copying the file into the bundle (converter rule) rather than pointing at shared paths.

Tasks

  • [ ] Maintainers confirm.
  • [ ] Converter: copy out-of-bundle front-matter images into the bundle and rewrite the path (clears the 40 warnings).
  • [ ] Document the rule in CHEATSHEET.md.

Contributor Resources and Handbook

The layer5.io website uses Gatsby, React, and GitHub Pages. Site content is found under the master branch.

Join the Layer5 Community by submitting your community member form.

saurabhraghuvanshii avatar Nov 03 '26 16:11 saurabhraghuvanshii

Hi @saurabhraghuvanshii , I would like to work on this issue. Could you please assign it to me?

DRafi2006 avatar Nov 04 '26 04:11 DRafi2006

Hi @saurabhraghuvanshii @PARTH-TUSSLE , I'd like to work on this. While looking into it I found that the converter only checks some of the image fields. Dark-mode thumbnails like darkthumbnail aren't checked, so about 43 more images point outside their page folder and get no warning. I'd fix all of them, add a test and document the rule in the cheatsheet. Could you assign this to me?

ayushgade06 avatar Nov 05 '26 09:11 ayushgade06

Audit Update: Out-of-Bundle Asset Files (37 files)

Following the PR #8460 resolution for imported JSX assets, 37 files across the repository have been verified to reference assets pointing outside the page bundle (to ../../assets/...). These assets publish with broken-relative paths until the image layout decision for #8308 is implemented (e.g. copying out-of-bundle assets into the bundle or using assets/images / resources.Get).

37 Files with Out-of-Bundle Asset References:

  1. blog/2020/2020-03-11-deploying-linkerd-with-meshery/index.mdx (primary owner: #8308)
  2. blog/2021/2021-02-04-meet-the-maintainer-michael-gfeller/index.mdx (primary owner: #8453)
  3. blog/2021/2021-04-05-meshmate-of-the-year-2020-nikhil-ladha/index.mdx (primary owner: #8308)
  4. blog/2021/2021-04-19-announcing-meshery-v0.5/index.mdx (primary owner: #8308)
  5. blog/2021/2021-10-01-pipelining-service-mesh-specifications/index.mdx (primary owner: #8308)
  6. blog/2021/2021-10-09-an-introduction-to-meshery/index.mdx (primary owner: #8308)
  7. blog/2022/2022-05-20-meshmate-of-the-year-2021-aditya-chatterjee/index.mdx (primary owner: #8308)
  8. blog/2022/2022-06-07-week-open-source-contributions-with-layer5/index.mdx (primary owner: #8308)
  9. blog/2023/05-24-meet-the-meshmate-yash-sharma/index.mdx (primary owner: #8453)
  10. blog/2024/02-13-what-is-platform-engineering/index.mdx (primary owner: #8308)
  11. blog/2024/02-24-open-container-image-meshery/index.mdx (primary owner: #8308)
  12. blog/2024/04-26-docker-compose-with-meshery/index.mdx (primary owner: #8308)
  13. blog/2024/07-01-meet-the-maintainer-xin-huang/index.mdx (primary owner: #8453)
  14. blog/2024/09-08-meet-the-maintainer-hussaina-begum/index.mdx (primary owner: #8453)
  15. blog/2024/09-27-meet-the-maintainer-aisuko-li/index.mdx (primary owner: #8453)
  16. blog/2024/10-22-meet-the-maintainer-aadhitya-amarendiran/index.mdx (primary owner: #8453)
  17. blog/2024/11-01-meet-the-maintainer-yash-sharma/index.mdx (primary owner: #8453)
  18. blog/2024/11-05-what-is-the-kanvas-catalog/index.mdx (primary owner: #8308)
  19. blog/2025/05-28-meet-the-maintainer-ian-whitney/index.mdx (primary owner: #8453)
  20. blog/2025/08-27-meet-the-maintainer-aabid-sofi/index.mdx (primary owner: #8453)
  21. blog/2025/12-28-gemini-cli-trusted-directories/index.mdx (primary owner: #8308)
  22. blog/2026/03-02-meshery-hits-10000-github-stars/index.mdx (primary owner: #8308)
  23. blog/2026/03-26-meet-the-maintainer-sangram-rath/index.mdx (primary owner: #8453)
  24. blog/2026/04-02-open-source-maintenance-ai-contributors/index.mdx (primary owner: #8401)
  25. blog/2026/04-03-claude-code-skills-not-found-sessionstart-hook/index.mdx (primary owner: #8308)
  26. blog/2026/06-22-meet-the-maintainer-mia-grenell/index.mdx (primary owner: #8453)
  27. blog/2026/09-14-disable-claude-code-session-feedback-survey/index.mdx (primary owner: #8308)
  28. blog/2026/09-16-ai-system-1-versus-system-2-tasks/index.mdx (primary owner: #8308)
  29. blog/blog-template/index.mdx (primary owner: #8308)
  30. blog/meetTheMaintainer-template/index.mdx (primary owner: #8453)
  31. events/2022/servicemeshcon-EU-2022/index.mdx (primary owner: #8308)
  32. handbook/community/index.mdx (primary owner: #8308)
  33. handbook/connect-with-us/index.mdx (primary owner: #8308)
  34. handbook/projects/index.mdx (primary owner: #8308)
  35. handbook/repository-overview/index.mdx (primary owner: #8456)
  36. handbook/security-vulnerabilities/index.mdx (primary owner: #8308)
  37. resources/case-study/hpes-adoption-of-meshery-and-kanvas/index.mdx (primary owner: #8454)

(Note: In the converter report, 22 of these 37 have #8308 as their primary owner; the other 15 are primarily tracked under bespoke component or missing asset issues #8453, #8454, #8456, and #8401).

PARTH-TUSSLE avatar Nov 20 '26 15:11 PARTH-TUSSLE

Zero-Byte SVG Audit (integrations/)

Following an audit against origin/master, here is the breakdown of the 6 zero-byte SVGs logged during migration:

  1. Empty in source repository (origin/master):

    • src/collections/integrations/rustrial-aws-eks-iam-auth-controller/icons/components/iam-identity-mapping/icons/color/iam-identity-mapping-color.svg (0 bytes)
    • src/collections/integrations/rustrial-aws-eks-iam-auth-controller/icons/components/iam-identity-mapping/icons/white/iam-identity-mapping-white.svg (0 bytes)
    • src/collections/integrations/vald/icons/components/vald-mirror-target/icons/white/vald-mirror-target-white.svg (0 bytes)
    • src/collections/integrations/vald/icons/white/vald-white.svg (0 bytes) These 4 files are 0 bytes in the primary upstream source repository (origin/master) and represent source-repo data issues.
  2. Non-empty on origin/master, emptied on hugo branch:

    • src/collections/integrations/rustrial-aws-eks-iam-auth-controller/icons/color/rustrial-aws-eks-iam-auth-controller-color.svg (2,527 bytes on origin/master)
    • src/collections/integrations/rustrial-aws-eks-iam-auth-controller/icons/white/rustrial-aws-eks-iam-auth-controller-white.svg (2,374 bytes on origin/master) These 2 files contain valid SVGs on origin/master, but were truncated to 0 bytes on the hugo branch during merge commit db24f0195df (PR #8291).

PARTH-TUSSLE avatar Nov 20 '26 18:11 PARTH-TUSSLE

Zero-Byte Asset Reconciliation & Upstream Audit

A fresh, comprehensive repository-wide audit (\git ls-tree -r -l) scanning for any 0-byte .svg, .png, .webp, and .pdf\ files across both \origin/master\ and \hugo\ branches resolves the earlier discrepancy:

1. Reconciliation of Earlier 6 Integration Names

An earlier note cited \pache-camel, \ackstage, \ luentd, \jenkins, \kyverno, and
ats. That list was conflated with integration component frontmatter/model warnings; none of those files are 0-byte assets on disk. For instance, \ackstage-color.svg\ (4,769 B), \ luentd-color.svg\ (5,124 B), and \kyverno-color.svg\ (3,211 B) are fully populated valid SVGs.

2. Exact 0-Byte Asset Files on \origin/master\ (4 files)

The source repository upstream (\origin/master) contains exactly 4 zero-byte SVGs (source repository upstream data issue):

  1. \src/collections/integrations/rustrial-aws-eks-iam-auth-controller/icons/components/iam-identity-mapping/icons/color/iam-identity-mapping-color.svg\ (0 bytes)
  2. \src/collections/integrations/rustrial-aws-eks-iam-auth-controller/icons/components/iam-identity-mapping/icons/white/iam-identity-mapping-white.svg\ (0 bytes)
  3. \src/collections/integrations/vald/icons/components/vald-mirror-target/icons/white/vald-mirror-target-white.svg\ (0 bytes)
  4. \src/collections/integrations/vald/icons/white/vald-white.svg\ (0 bytes)

3. Exact 0-Byte Asset Files on \hugo\ (6 files)

On \hugo, the 4 upstream files above were present plus 2 icons truncated to 0 bytes during merge commit \db24f0195df\ (PR #8291): 5. \src/collections/integrations/rustrial-aws-eks-iam-auth-controller/icons/color/rustrial-aws-eks-iam-auth-controller-color.svg\ (2,527 bytes on master -> 0 bytes on hugo) 6. \src/collections/integrations/rustrial-aws-eks-iam-auth-controller/icons/white/rustrial-aws-eks-iam-auth-controller-white.svg\ (2,374 bytes on master -> 0 bytes on hugo)

4. Resolution

Pull Request #8473 has been opened against \hugo\ restoring the two truncated rustrial icons from \origin/master. Once merged, \hugo\ matches \origin/master\ exactly with only the 4 source-repo empty assets remaining.

PARTH-TUSSLE avatar Nov 21 '26 06:11 PARTH-TUSSLE

Decision recorded: Option 1 (page bundles only) for #8308.

  • Rationale: Keeps every page self-contained for Hugo's responsive-image pipeline (WebP/AVIF resizing requires Page Resources), avoids a hugo/assets/ mount that breaks --baseURL subpath previews without template rewrites, and preserves zero URL changes (1006/1006 non-Sistent docs).
  • Measurements (origin/hugo vs #8539 prototype):
    • Out-of-bundle asset warnings: 49 files -> 0 (+31 unique assets pulled into bundles, 114 total bundle copies, +18.0 MB disk delta, +238 ms build time delta).
    • Subpath (--baseURL https://x.test/hugo-preview/pr-1/) & root checks on the 49 pages: 47/49 pass (hpes-adoption-of-meshery-and-kanvas passes once #8542 lands; 11-05-what-is-the-kanvas-catalog misses import-design-gif.gif in source).
  • PRs: #8539 (Option 1 asset bundling), split out from it: #8542 (inline-quotes.html ./ trim), #8543 (own-bundle root-relative <img> rewrite).

PARTH-TUSSLE avatar Nov 28 '26 07:11 PARTH-TUSSLE