Support per-page published locales in Fern Docs

Aperta
#18,892 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
28/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
typescript

Direzione di ricerca

Start by reading the existing locale handling for Markdown/MDX frontmatter, page navigation, language switching, and discovery metadata, then trace how fern check validates pages. The payload names no source files or tests, so locate the relevant entry points in the repository. Done means per-page locale declarations control visibility and direct URL behavior, preserve existing fallback when omitted, and fern check reports unknown or missing translations.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Use case

A Fern Docs site can support en, zh, ja, ru, and ko overall while publishing a particular guide or answer only in English and Chinese. Authors need to distinguish intentionally not published in this locale from a translation is missing and fallback is expected.

Current behavior

In a hosted preview built with Fern CLI 5.148.2, an English/Chinese-only Markdown page still returned HTTP 200 with English content when requested under /ja/, /ru/, or /ko/. The localized sitemap and llms.txt already excluded those fallback URLs, which is good. This request is not about fixing sitemap indexing; it is about giving authors explicit control over where a page is published and what readers see in the language picker and at a direct URL.

Proposal

Add an optional per-page locale allowlist to Markdown/MDX frontmatter (or to the page node in docs.yml; name shown for illustration):

---
title: Example task guide
published-locales: [en, zh]
---
  • When omitted, preserve today's automatic fallback behavior.
  • When set, expose only the listed, translated versions in page navigation, page-level language switching, and discovery metadata (hreflang, sitemap, and llms.txt). Keep the site-wide language selector and other pages unchanged.
  • For an unlisted locale URL, do not silently return a localized 200 containing the default-language page. Redirect to the corresponding published default-language page, or return a not-available response with a link to it. Either behavior would distinguish this from missing-translation fallback.
  • Have fern check report an unknown locale or a listed locale whose translation is missing, so the declared release scope can be checked before publishing.

Related to #6490. Is there already a supported way to express this per page across local previews and hosted docs?

Lingua principale
TypeScript
Stelle
3.8k
Fork
376
Merge medio
9h 15m
PR unite (30g)
171

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di fern-api/fern

Tutte le issue di fern-api/fern

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.