feat(site): one legal entity per domain - #53
Merged
Merged
Conversation
mobiera.com keeps Mobiera SAS (Colombia); mobiera.io now shows Mobiera Norte SA (Panama): name, Mercantile Registry folio, address, city, data-protection law, canonical origin. The proxy picks the site from the request headers and rewrites to the internal path /<site>/<locale>/..., so every page stays prerendered, once per site and language. app/lib/entity.ts is the single definition of both entities. Message files name the entity through [[tokens]] resolved per site when messages load. Footer, contact and privacy pages, structured data, canonical and hreflang links, sitemap, robots.txt, the RSS feed, the social image and the contact emails follow the domain. The response carries x-mobiera-site for verification. The social image becomes a route (/og-image) because the file convention published the internal path.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The same site answers on two domains, and the domain now decides the legal entity shown:
How
app/lib/entity.tsis the single definition of both entities (name, registration, address, city, data-protection law, canonical origin).proxy.tspicks the site from the request (x-mobiera-site, then forwarded-host headers, thenHost; any header naming mobiera.com wins, because that domain arrives through a reverse proxy) and rewrites to the internal path/<site>/<locale>/.... Pages stay prerendered, once per site and language. Visitors never see the site segment. The response headerx-mobiera-sitereports the choice.[[tokens]]([[legalName]],[[legalRegistration]],[[legalAddress]],[[legalCity]],[[siteDomain]], ...) resolved per site when messages load, so no copy is duplicated./og-image,/es/og-image): the file convention published the internal path.To check before merging
curl -sI https://www.mobiera.com/ | grep -i x-mobiera-sitemust answercom. If it answersio, addRequestHeader set X-Mobiera-Site "com"to the Apache vhost (seedocs/configuration.md). Until then mobiera.com visitors would see the Panama entity.spec/facts.yamlfor confirmation: the mobiera.io privacy policy cites Panamanian Law 81 of 2019 with a 10 business day answer; history copy on mobiera.io says "Mobiera was founded in Bogotá in 2012" while the timeline keeps "Mobiera SAS incorporated in Bogotá"; the footer copyright keeps 2012.SITE_URLis no longer read by the app (build args and chart value are now inert and can be removed later).Verified
Type-check, 11 unit tests (host detection, tokens), full build, and the standalone server driven with
Hostheaders: both entities in English and Spanish on every affected page, canonical and hreflang per domain, sitemap, robots and feed per domain, locale redirect, 404s, 410s, Hugo redirects, internal paths answering 404, contact API. A real browser per domain confirmed no hydration errors and that client-side navigation keeps the entity.