Descripción
En Gutenberg, añade un bloque y busca «SimpleTOC» o simplemente «TOC». Por favor, guarda tu contenido antes de usar el bloque. Funciona analizando el contenido de la entrada y recuperando los bloques de encabezado y crea un nuevo bloque dinámico con una lista de enlaces a los encabezados.
Hide the headline «Table of Contents» and set a maximum display depth in the blocks’ sidebar configuration. Add the CSS class «simpletoc-hidden» to a heading block to remove that specific heading from the generated TOC.
Características
- Sin JavaScript o CSS añadido.
- Diseñado para Gutenberg.
- Compatible con plugins AMP.
- Salida HTML mínima y válida.
- Hereda el estilo de tu tema.
- Support for column block layouts.
- Control the maximum depth of the headings.
- Choose between an ordered and unordered html list.
- SEO friendly: Disable the h2 heading of the TOC block and add your own.
- Comes with English, French, Spanish, German, and Brazilian Portuguese translations.
- Works with non-latin texts. Tested with Japanese and Arabic.
- Finds headlines in groups and reusable blocks. And in groups within reusable blocks.
- Compatibilidad con Rank Math.
Credits
Este plugin se ha bifurcado de https://github.com/pdewouters/gutentoc por pdewouters y usa el código de https://github.com/shazahm1/Easy-Table-of-Contents por shazahm1
Many thanks to Tom J Nowell https://tomjn.com and and Sally CJ who both helped me a lot with my questions over at wordpress.stackexchange.com
Capturas
Bloques
Este plugin proporciona 1 bloque.
- SimpleTOC - Table of Contents Block
Instalación
SimpleTOC se puede encontrar e instalar a través del menú «Plugins» dentro de la administración de WordPress (Plugins -> Añadir nuevo). Como alternativa, se puede descargar desde WordPress.org e instalarlo manualmente…
En Gutenberg, añade un bloque y busca «SimpleTOC» o simplemente «TOC». Por favor, guarda tu contenido antes de que uses el bloque.
FAQ
-
Why did you do this?
-
Because I needed a simple plugin to do this job and decided to do it on his own. I believe that a Table of Contents does not need Javascript and additional css. Furthermore the plugin should work out-of-the-box without any configuration.
-
How do I change the TOC heading ‘Table of contents’ to some other words?
-
Hide the headline in the sidebar options of SimpleTOC and add your own heading.
-
How do I add SimpleTOC to all articles automatically?
-
I don’t see an easy solution at the moment. SimpleTOC is only a block that can be placed in your post. If there would be 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. Maybe someone knows of a plug-in that adds blocks automatically to all posts with some parameters and settings? What about site editing in WordPress? I think the core team is working on something like that. I will keep this post open. If I have gained more knowledge how to solve this I will add this feature.
-
How do I add a background color to SimpleTOC?
-
SimpleTOC is simple. It will never load JavaScript or CSS. But you can add custom CSS yourself to your theme:
.simpletoc { padding: 1em 2em; background: #bada55; }
If you want to add a color including the headline, add a custom css class to the SimpleTOC block. Name it «toctoc» or something like that.
.toctoc { padding: 1em 1em; background: #bada55; }
If you use that CSS it will add a colored background to the whole TOC including the heading.
Reseñas
Colaboradores y desarrolladores
«SimpleTOC – Table of Contents Block» es un software de código abierto. Las siguientes personas han colaborado con este plugin.
Colaboradores«SimpleTOC – Table of Contents Block» ha sido traducido a 8 idiomas locales. Gracias a los traductores por sus contribuciones.
Traduce «SimpleTOC – Table of Contents Block» a tu idioma.
¿Interesado en el desarrollo?
Revisa el código , echa un vistazo al repositorio SVN o suscríbete al registro de desarrollo por RSS.
Registro de cambios
4.4.9.2
- Refactoring: Better TOC generation with less HTML validation errors.
4.4.9
- Feature: Support for headlines in reusable blocks.
4.4.8
- Feature: Added option to toggle absolute urls.
4.4.7
- Fix: Heading ids won’t be added to all posts anymore.
- Fix: Headings with attributes like align-center will now appear in your TOC.
- Feature: Added option to replace ul tag with ol tag. This will add decimal numbers to each heading in the TOC.
- Feature: Works in nested blockes. This means support for column block layouts.
4.3
- Feature: Support for non-latin headlines. SimpleTOC now uses a character block list rather than an allow list.
- Feature: Add the CSS class «simpletoc-hidden» to the heading block to remove it from the Table of Contents.
4.1.1
- Feature: Experimental support for Arabic Text.
4.0
- Feature: Added option to set maximum level of the headings.
3.9
- Added Brazilian Portuguese translations to the translations. Thanks Ralden Souza!
3.5
- Añadida compatibilidad para el plugin Rank Math.