davsclaus opened a new pull request, #1889: URL: https://github.com/apache/camel-website/pull/1889
Refs #1878. This PR covers the meta descriptions, Open Graph/Twitter cards, JSON-LD, robots.txt and regression checks from the ticket. The versioned-docs canonicals and sitemaps are left as a follow-up, explained below. ## Analysis - **Meta descriptions:** `header.html` only wrote `<meta name="description">` when the page had a `description`. Blog posts carry `preview`, so they had none. - **Docs pages:** they only had a description when the AsciiDoc page set `:description:`. - **Open Graph on the docs:** every page had `og:url=https://camel.apache.org`, the same static `og:description` and an SVG `og:image`. - **Open Graph on the blog:** posts had `og:type=website`, and their `og:image` was the full-size featured image. - **JSON-LD:** the Antora Organization block had a relative SVG logo and the old "Scala DSL" description. The Hugo breadcrumb names were URL slugs, and the year/month segments of blog URLs, which don't exist as pages, were listed as breadcrumbs. ## Changes **Hugo pages** - `layouts/partials/seo/description.html` picks the description from, in order: - the one-line `summary` for security advisories (their `description` is the full advisory text); - `description`, then `preview`; - a generated sentence for release notes and blog category pages; - the start of the page content. Front matter values are capped at 300 characters and content excerpts at 160. The same text is used for `<meta name="description">`, `og:description` and the BlogPosting JSON-LD. - Added `description` to the blog, download, releases, security, sitemap and tooling section pages. - **Blog posts** now get: - `og:type=article`; - `article:published_time`, plus `article:author` (GitHub profile) and `article:tag`; - a `BlogPosting` JSON-LD block. - **`og:image`** (`layouts/partials/seo/image.html`): - A featured image of at least 1200×630 is cropped to 1200×630 JPEG with `.Fill`. - A smaller one is used as it is. - SVG is skipped. - Otherwise it falls back to the new `static/img/social-card.png`. - Added `og:image:width/height` and `twitter:card=summary_large_image`. - **JSON-LD** is now built with `jsonify`, so it is always valid JSON: - The Organization logo is `static/img/logo-camel-512.png`. - Breadcrumb names come from page titles, and only pages that exist are listed. - `robots.txt` lists only the `sitemap.xml` index. **Antora docs** (`antora-ui-camel`; the tracked `public/_` copies are synced as in #1875) - `og:url` is the page's canonical URL. - A new `page_description` helper (with tests) supplies the meta description and `og:description`: - It uses `page.description` when set. - Otherwise it takes the first paragraph of at least 50 characters that doesn't introduce a list (ending in ":"), truncated to 160 characters. - `og:image` is the raster social card, and `twitter:card` is added. - The Organization JSON-LD uses the absolute PNG logo and the same description as `config.toml`. **Images** - `social-card.png` (1200×630, 87 KB) is generated from `logo-d.svg`: - `rsvg-convert` rendered the logo, then ImageMagick composed it with the Archivo font from `@fontsource/archivo`. - It uses the site's paper and orange colours. - `logo-camel-512.png` is `logo-d.svg` rendered with `rsvg-convert`. - Both live in Hugo's `static/img/`, so the URLs are stable and both the Hugo pages and the docs can use them. **Regression checks** - New html-validate rules: - `camel/meta-description`: an indexable page must have a non-empty meta description. Antora pages are skipped for now; see the follow-ups. - `camel/og-image`: `og:image` must be an absolute URL and not SVG. "Indexable" means the page has a canonical link, no meta refresh and no `noindex`, so redirect stubs and the link-checker workaround pages are not checked. - `test/seo-parity-test.js` fails when the Antora description, logo or `og:image` drift from `config.toml` and the Hugo default card. ## Verification - **Hugo build** (v0.121.2, with `GITHUB_TOKEN`): pages without a meta description went from **885 of 1031 to 29 of 1031**. The 29 left are static files that don't use the Hugo header: - the link-checker workaround pages under `*/latest/`; - `schema/*HEADER.html`; - the Google verification file. - **Image processing:** 20 posts get a cropped 1200×630 `og:image`, 48 use their smaller featured image as it is, and 220 use the social card. A clean build with no resource cache takes about 3 s. - **`yarn check:html`** on the minified (`CAMEL_ENV=production`) Hugo output passes, including the new rules and the JSON-LD parse check. Both rules were also tried on a page missing a description with an SVG `og:image`, and both reported it. - **`yarn test`**: 26/26 pass. - **`antora-ui-camel`**: `gulp lint`, `gulp test` (38/38) and `gulp bundle` pass. - **`gulp preview:build`** renders: - `og:url` as the page URL; - the fallback description from the first paragraph; - the PNG `og:image`; - the new Organization JSON-LD. - **Not run locally:** the full Antora docs build. CI's `build-all` and `checks` cover it. ## Follow-ups (not in this PR) - **Versioned-docs canonicals and sitemaps:** `sitemap-components.xml` still lists every version. Filtering it in `gulp sitemap` looks simple, but the comment there says Algolia also uses the sitemaps. Before dropping the `next` and older LTS URLs, someone should check that the DocSearch crawler config doesn't depend on them. The same goes for a stable `/latest/` canonical and `noindex` on `next`. - **Antora meta-description check:** remove the Antora skip in `camel/meta-description` once a full build shows how many docs pages have no paragraph to fall back on. - **Per-post generated OG images** for posts without a featured image (220 now use the generic card). 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_016Y4dDj46SB6GniXf8mX2U6 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
