Explore adding top-level "API" link to header nav
Nessuno ha ancora preso questa issue.
- Lingua principale
- JavaScript
- Stelle
- 11.8k
- Fork
- 7.9k
- Merge medio
- 1g 11h
- PR unite (30g)
- 11
Descrizione
This discussion thread on Twitter provided feedback that the reference section of the docs may not be very discoverable due to the new website's accordion sidebar.
@gaearon proposed we could do something similar to what Jest does and add an "API" link to the header that directly opens the first page of the reference section (eg React Top-Level API).
Unfortunately this is a little more complicated than it would seem at a glance because of:
- How we determine which header link gets the "active" style. If we added a new "API" link, both it and "Docs" would share the same "/docs" URL path. (Jest side-steps this issue by not applying "active" header link styles.)
- We try to maintain symmetry between the location of markdown content (eg content/blog, content/docs) and the top-level nav structure (eg "Blog", "Docs")
Unfortunately we can't rely on anything dynamic (like markdown frontmatter tags) to help with the "active" link styling because the header and footer are part of the "static" Gatsby layout. (Technically we could move them into the templates but this doesn't seem ideal.)
We could move reference docs into a new folder (eg "content/api") give them a unique URL prefix (eg "/api") but we'd need to leave backwards-compatible redirects (eg redirect_from like here) in place so that no bookmarked links were broken. This would also require separating "Docs" and "API" sidebar structure.
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia da src/components/LayoutHeader/Header.js e dalla struttura content/docs, quindi esamina come viene determinato l'attuale link attivo dell'header. Confronta lo spostamento proposto di /api, i redirect come redirect_from e una struttura separata della sidebar. Il lavoro sarà completato quando un link API nell'header aprirà la sezione di riferimento senza interrompere i link esistenti o lo stile della navigazione attiva.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- javascript, react
- Ambito
- documentation, frontend, web-dev
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100