layer5 icon indicating copy to clipboard operation
layer5 copied to clipboard

[Hugo] Phase 1 · Decision: hosting, redirects and trailing slashes

Open saurabhraghuvanshii opened this issue 1 month ago • 4 comments

Parent: #8297 · Open decision: "Hosting and redirects (Cloudflare redirect rules, Cloudflare Pages, or Netlify)"

Facts (checked 2026-11-03)

  • Production is GitHub Pages, not Netlify. .github/workflows/build-and-deploy-site.yml builds Gatsby and pushes public/ to gh-pages with JamesIves/github-pages-deploy-action. It writes CNAME and .nojekyll and excludes pr-preview/ and .well-known/ from cleaning. PR previews are published to https://layer5.io/pr-preview/pr-<n>/ by rossjrw/pr-preview-action.
  • GitHub Pages ignores _redirects. The Redirects output format in hugo.yaml (and FIRST_RUN_REPORT §4) has no effect there.
  • Redirects today are HTML stubs. https://layer5.io/books/ returns <meta http-equiv="refresh" content="0; URL='/learn/service-mesh-books'"><link rel="canonical" …>, written by plugins/gatsby-plugin-meta-redirect. Hugo aliases produce the same kind of stub by default.
  • Trailing slashes: https://layer5.io/company/about → 301 → /company/about/ (served by GitHub Pages). The canonical and og:url tags and the sitemap use /company/about without a slash, so the canonical URL currently points at a redirect.

Recommendation

  1. Stay on GitHub Pages for the cutover. Only the build step changes: no DNS change, and PR previews and .well-known/ keep working. Revisit Cloudflare after cutover as a separate project.
  2. Redirects = Hugo aliases (HTML stubs), the same mechanism as today. Keep the _redirects output only if a host that supports it is chosen later.
  3. Trailing slash: emit /path/ (Hugo's default) for canonical, sitemap and internal links. That is the URL that returns 200, which fixes the current canonical-to-redirect problem. Every old slash-less URL keeps working through the existing GitHub Pages 301.

Tasks

  • [ ] Maintainers confirm or amend 1–3 in this issue.
  • [ ] Record the decision in hugo/README.md. Remove or flag the Redirects output format accordingly.
  • [ ] Customize layouts/alias.html (if needed) to match the current stub (meta refresh + canonical).

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? I’ll investigate and work on the required changes. Thank you!

DRafi2006 avatar Nov 04 '26 04:11 DRafi2006

Hi @saurabhraghuvanshii, I'd like to work on this issue

08abhinav avatar Nov 04 '26 16:11 08abhinav

Checking in... it has been awhile since we've heard from you on this issue. Are you still working on it? Please let us know and please don't hesitate to contact a MeshMate (https://meshery.io/community/meshmates/) or any other community member (https://meshery.io/community) for assistance.

ritzorama avatar Nov 25 '26 11:11 ritzorama

Thanks @08abhinav - PR #8501 merged on 2026-11-27, so this looks resolved. Leaving it open for a maintainer to confirm and close.

ritzorama avatar Dec 02 '26 11:12 ritzorama