Descrição
Add a Table of Contents block to your posts and pages. The TOC is a nested list of links to all heading found in the post or page. To use it, simply add a block and search for “SimpleTOC” or just “TOC”.
The maximum depth of the toc can be configured in in the blocks’ sidebar among many other options. There can hide the headline “Table of Contents” and add your own by using a normal heading block.
Recursos
- Zero configuration: Add the SimpleTOC block to your post and that’s it.
- Saída HTML mínima e válida.
- No JavaScript or CSS added.
- Projetado para Gutenberg
- Style SimpleTOC with Gutenberg’s native group styling options.
- Herda o estilo do seu tema.
- Comes with English, Chinese (Taiwan), French, Spanish, German, Latvia and Brazilian Portuguese translations.
Customization
- Add background and text color with Gutenberg groups.
- Native block support for wide and full width.
- Controle a profundidade máxima dos títulos.
- Choose between an ordered and unordered HTML list.
- Toggle list indent.
- Disable the h2 heading of the TOC block and add your own.
Compatibility
- GeneratePress and Rank Math support.
- Works with all popular AMP plugins.
Créditos
Este plugin é derivado de https://github.com/pdewouters/gutentoc, de pdewouters, e usa o código de https://github.com/shazahm1/Easy-Table-of-Contents, de shazahm1
Muito obrigado a Tom J Nowell, https://tomjn.com, e Sally CJ, que me ajudaram muito com minhas perguntas no wordpress.stackexchange.com
Thanks to Quintus Valerius Soranus for inventing the Table of Contents around 100 BC.
SimpleTOC is developed on GitHub: https://github.com/mtoensing/simpletoc
Imagens de tela
Blocos
Este plugin disponibiliza 1 bloco.
- SimpleTOC Adds a Table of Contents.
Instalação
SimpleTOC pode ser encontrado e instalado através do menu Plugin na administração do WordPress (Plugins -> Adicionar Novo). Como alternativa, ele pode ser baixado do WordPress.org e instalado manualmente…
No Gutenberg, adicione um bloco e pesquise “SimpleTOC” ou apenas “TOC”. Salve seu conteúdo antes de usar o bloco.
FAQ
-
Por que você fez isso?
-
Porque eu precisava de um plugin simples para fazer este trabalho e decidi fazê-lo por conta própria. Acredito que um Sumário não precisa de JavaScript e CSS adicional. Além disso, o plugin deve funcionar fora da caixa, sem nenhuma configuração.
-
Como mudar o título do ‘Sumário’ para outra palavra?
-
Esconda a manchete nas opções da barra lateral do SimpleTOC e adicione seu próprio título.
-
Como adicionar o SimpleTOC a todos os artigos automaticamente?
-
No momento, eu não vejo uma solução fácil. O SimpleTOC é apenas um bloco que pode ser colocado no seu post. Se houvesse um plugin que adicionasse blocos a cada post, então esta seria a solução. Eu acho que este deveria ser outro plugin separado para manter o código do SimpleTOC limpo e… bem, simples. Talvez alguém saiba de um plugin que adiciona blocos automaticamente a todos os posts, com alguns parâmetros e configurações? E quanto à edição do site no WordPress? Eu acho que a equipe do núcleo está trabalhando em algo assim. Vou manter este post aberto. Se eu tiver adquirido mais conhecimentos sobre como resolver isto, acrescentarei este recurso.
-
How do I add a background color to SimpleTOC using Gutenberg groups?
-
Select the block and select “group” in the context menu. Apply “background color”, “link color” and “text color” to this group. SimpleTOC will inherit these styles. You would like to use this styled SimpleTOC group next time you write a post? Convert it to a reusable block.
-
Como eu posso inserir rolagem suave?
-
Opcionalmente, você pode adicionar a classe css “smooth-scroll” a cada link do Sumário. Então você pode instalar o plugin que utiliza estas classes.
-
How do I hide a single heading?
-
If you really want to hide a single heading from the table of contents then add the CSS class “simpletoc-hidden” to a heading block. But first of all, think about the reason you want to hide a specific heading. Maybe you want to remove all headins of a specific depth level. Then there is an option for that in the blocks options in Gutenberg. If you think this heading should not be part of the toc maybe it is not needed in the post itself?
Avaliações
Colaboradores e desenvolvedores
“SimpleTOC – Bloco de sumário” é um software com código aberto. As seguintes pessoas contribuíram para este plugin.
Colaboradores“SimpleTOC – Bloco de sumário” foi traduzido para 10 localizações. Agradecemos aos tradutores por suas contribuições.
Traduzir “SimpleTOC – Bloco de sumário” para o seu idioma.
Interessado no desenvolvimento?
Navegue pelo código, dê uma olhada no repositório SVN ou assine o registro de desenvolvimento via RSS.
Registro de alterações
5.0.18
- Fix: Attempt to read property “post_content” on null in logs
5.0.17
- Feature: Support for custom Anchor IDs in headings. Thank you Matthias Altmann!
5.0.16
- Fix: Anchor ids will be generated for all posts. This should brute-force the fix for https://wordpress.org/support/topic/scroll-stopped-working/
5.0.11
- Feature: Support for GeneratePress headings.
- Fix: Headings in groups work again.
5.0.9
- Works with WordPress 6.0
- Support for paginated posts.
5.0.8
- Fix: Requires at least WordPress 5.8. and not 5.9.
- Fix: Better compatibility with Twenty-Twenty-One.
- Fix: Localization is back again.
- Feature: Added “simpletoc-title” and “simpletoc-list” CSS classes. This might break existing custom CSS styles that have not been applied with Gutenberg.
- Feature: Toggle list indent.
- Feature: Better “group” support. Put SimpleTOC in a group and style it with Gutenberg. See FAQ for details.
- Feature: Native block support for wide and full width.
- Feature: Added block.json and refactoring with coding standards for Gutenberg blocks.
4.5
- Feature: Add the CSS class “smooth-scroll” to the links. This enables smooth scrolling in themes like GeneratePress.
4.4.9
- Recurso: suporte para manchetes em blocos reutilizáveis.
4.4.8
- Feature: Added option to toggle absolute URLs.
4.4.7
- Recurso: Adicionada a opção para substituir a tag ul pela tag ol. Isso adicionará números decimais a cada título no sumário.
4.3
- Recurso: Suporte para títulos não latinos. SimpleTOC agora usa uma lista de blocos de caracteres, em vez de uma lista de permissões.
- Recurso: Adicione a classe CSS “simpletoc-hidden” ao bloco de título para removê-lo do sumário.
4.1.1
- Recurso: suporte experimental para texto árabe.
3.9
- Adicionadas traduções do português brasileiro. Obrigado Ralden Souza!
3.5
- Adicionado suporte para o plugin Rank Math.