Explore adding top-level "API" link to header nav
Ninguém assumiu esta issue ainda.
- Linguagem predominante
- JavaScript
- Estrelas
- 11.8k
- Forks
- 7.9k
- Merge médio
- 1d 11h
- PRs com merge (30d)
- 11
Descrição
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.
Guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Direção de pesquisa
Comece por src/components/LayoutHeader/Header.js e pela estrutura de content/docs; em seguida, analise como o link ativo atual do cabeçalho é determinado. Compare a proposta de mover /api, os redirecionamentos como redirect_from e uma estrutura separada de barra lateral. O trabalho estará concluído quando um link de API no cabeçalho abrir a seção de referência sem quebrar os links existentes nem o estilo da navegação ativa.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- javascript, react
- Domínio
- documentation, frontend, web-dev
- Tipo de issue
- Funcionalidade
- Dificuldade
- 5/5
- Tempo estimado
- Mais de uma semana
- Status de atividade
- Estagnada
- Clareza
- Razoavelmente clara
- Facilidade para iniciantes
- 35/100