From b2bfb734c6afeffc6ccd898a705abb391c8a4d90 Mon Sep 17 00:00:00 2001 From: Javier Cicchelli Date: Fri, 4 Sep 2026 15:13:29 +0200 Subject: [PATCH] Documented the alternate locales of the Social Card in the Infrastructure package. --- Packages/Infrastructure/README.md | 2 +- .../Sources/Public/Types/SocialCard/SocialCardTag.swift | 1 + Services/Website/README.md | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Packages/Infrastructure/README.md b/Packages/Infrastructure/README.md index ae93c77..9571378 100644 --- a/Packages/Infrastructure/README.md +++ b/Packages/Infrastructure/README.md @@ -7,7 +7,7 @@ The shared [Hummingbird](https://github.com/hummingbird-project/hummingbird) too | Routing | `RouterController`, `RouteCollectionBuilder`, the `addController` extension on `RouterMethods` | | Middlewares | `SecurityHeadersMiddleware`, `HTTPSRedirectMiddleware`, `TrailingSlashRedirectMiddleware`, `VaryMiddleware`, `RateLimitMiddleware`, `LocalizationMiddleware` (negotiating from a `lang` query parameter, then a leading path segment, then `Accept-Language`), `NotFoundMiddleware` | | Pages and assets | `Page`, `Asset`, `AssetExtension`, `FingerprintAssets` | -| Link previews | `SocialCard`, its `Image` and `Style`, and the `Tag` meta tags it derives | +| Link previews | `SocialCard`, its `locale` and the `alternateLocales` of its other language editions, its `Image` and `Style`, and the `Tag` meta tags it derives | | Structured data | `StructuredData`, the `Node`, `Property`, and `Value` types of its schema.org graph, the open `Name` and `Kind` vocabularies, and the site-wide initializer building the `Organization`/`WebSite` pair | | Analytics | `Analytics`, the `Event`s a page reports (with `tagging()` to apply one to any attribute-bearing HTML or SVG tag), the tracker script `Attribute`s it derives, the optional session `recorder` script paired with it, and the `origin` its preconnect hint targets | | Responses | `CachedHTMLResponse`, and `LocalizedHTMLCollectionResponse` rendering one of them per catalog language | diff --git a/Packages/Infrastructure/Sources/Public/Types/SocialCard/SocialCardTag.swift b/Packages/Infrastructure/Sources/Public/Types/SocialCard/SocialCardTag.swift index 1924635..d286881 100644 --- a/Packages/Infrastructure/Sources/Public/Types/SocialCard/SocialCardTag.swift +++ b/Packages/Infrastructure/Sources/Public/Types/SocialCard/SocialCardTag.swift @@ -60,6 +60,7 @@ extension SocialCard.Tag { case imageWidth = "og:image:width" /// The `og:locale` tag, carrying the locale of the card's text. case locale = "og:locale" + /// The `og:locale:alternate` tag, carrying the locale of one other language edition of the card's page; repeated once per edition. case localeAlternate = "og:locale:alternate" /// The `og:site_name` tag, carrying the name of the site the card belongs to. case siteName = "og:site_name" diff --git a/Services/Website/README.md b/Services/Website/README.md index e00147c..08c6709 100644 --- a/Services/Website/README.md +++ b/Services/Website/README.md @@ -60,7 +60,7 @@ Four of those are page-authored and optional. `IndexPage` supplies `canonicalURL | --- | --- | --- | | `summary` | `` | The page's one-line description. | | `canonicalURL` | `` | Absolute URL. `IndexPage` derives it from `site.origin` and the page's own language; an unset origin omits it (see [Language editions](#language-editions)). | -| `socialCard` | Open Graph + Twitter `` tags | A `SocialCard` — title, summary, URL, site name, locale, share image. Scrapers require absolute URLs, so the page composes them from its own origin; `Page+Defaults` supplies the locale as `ogLocale`. | +| `socialCard` | Open Graph + Twitter `` tags | A `SocialCard` — title, summary, URL, site name, locale, alternate locales, share image. Scrapers require absolute URLs, so the page composes them from its own origin; `Page+Defaults` supplies the locale as `ogLocale`. | | `structuredData` | `