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.
SimpleTOC is open-source and developed on GitHub Pages. If you find a bug or have an idea for a feature please feel free to contribute and create a pull request.
Spin up a new WordPress instance with the SimpleTOC plugin already installed.
Recursos
- Projetado para Gutenberg
- 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. Unless you activate the accordion menu.
- Style SimpleTOC with Gutenberg’s native group styling options.
- Herda o estilo do seu tema.
- Efeito de rolagem suave usando CSS.
- Rótulo ARIA opcional e atributos de função de navegação.
- Translated in multiple languages. Including German, Japanese, Chinese (Taiwan), Dutch, Brazilian Portuguese, French, Spanish and Latvia.
Customization
- Administrators can utilize global settings to supersede the individual block settings.
- Add background and text color with Gutenberg groups.
- Native block support for wide and full width.
- Controle a profundidade máxima dos títulos.
- Escolha entre uma lista HTML ordenada e com marcadores. Ou recue a lista.
- Selecione um nível de título ou transforme-o em um parágrafo.
- Disable the h2 heading of the TOC block and add your own.
Compatibility
- GeneratePress and Rank Math support.
- Works with popular AMP plugins.
Créditos
This plugin is forked from pdewouters and uses code from Easy-Table-of-Contents
Muito obrigado a Tom J Nowell 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.
Imagens de tela
Bloco do SimpleTOC no editor do Gutenberg. SimpleTOC no post. Simples, mas poderoso. Personalize cada sumário como desejar. Controle a profundidade máxima dos títulos. SimpleTOC styled with Gutenbergs native group styles. SimpleTOC Advanced Recursos Gutenberg Heading block: Set a custom anchor SimpleTOC escondido no menu sanfona. SimpleTOC global settings.
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
-
Configuring Global Settings in SimpleTOC
-
SimpleTOC allows you to configure global settings for your WordPress website. These settings can be enforced globally, overriding any block-level configurations that may exist. To access these settings, navigate to the SimpleTOC section of the WordPress Settings.
-
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.
-
How to exclude a single heading from the TOC?
-
Se você realmente quiser ocultar um único título do sumário, então adicione a classe CSS “simpletoc-hidden” a um bloco de título. Você pode encontrar este campo no mesmo lugar que o campo âncora HTML: Na barra lateral Bloco > Avançado. Mas primeiro, pense no motivo pelo qual você gostaria de esconder um título específico. Talvez você queira remover todos os títulos de um nível de profundidade específico. Então há uma opção para isso nas opções de blocos no Gutenberg. Se você acha que este título não deve fazer parte do sumário, talvez não seja necessário no próprio post?
-
I would like to save my SimpleTOC settings as default. Is that possible?
-
You can convert your configured SimpleTOC block into a reusable block in Gutenberg. It will keep its settings. This way, you can use your desired settings for each new post by adding the reusable block.
-
How to add a div tag wrapper to the TOC?
-
If you add a custom class to the SimpleTOC block in “Advanced” and then “Additional CSS Class(es)” a div with that class will be wrapped around the HTML output.
-
How to allow developers to exclude specific headings programmatically?
-
Use the ‘simpletoc_excluded_blocks’ filter. For example, this code will exclude heading blocks that are inside a column block.
Example:
add_filter( 'simpletoc_excluded_blocks', function ( array $blocks ) { $blocks[] = 'core/column'; return $blocks; } );
-
O personagem heavy plus que eu usei não pode ser colorido com css sem hacks. Mas você pode alterar o ícone para outra coisa e alterar a cor do novo ícone.
.simpletoc-collapsible::after { content: "✖"; color: #e94c89; }
-
Como adicionar o SimpleTOC a todos os artigos automaticamente?
-
I don’t see an easy solution at the moment. SimpleTOC is only a block that can be placed in your post. If there was a plugin that adds blocks to every post, then this would be the solution. I think this should be another separate plug-in to keep the code of SimpleTOC clean and … well, simple.
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 16 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
6.0.10
- Added aria-hidden attribute to icon in accordion. Thanks Alex Stine!
6.0.9
- Added ARIA accessibility labels for the accordion. Thanks Amber Hinds!
- Fixed: Caching of accordion JavaScript. Thanks jghitchcock!
- Added correct ARIA controls attribute.
6.0.5
- Compatibilty with WordPress 6.3