• There really should only ever be one h1 on a page, which makes that kind of pointless in most contexts to show in the TOC – since that should match up with the name of the page and isn’t really part of the internal navigation of a page.

    Would it be possible to either 1) add an option to ignore h1 tags or 2) to ignore any headings used in the content before the TOC block is shown?

    Otherwise, I LOVE how lightweight this is. Way better than everything else out there.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Marc Toensing

    (@marcdk)

    “There really should only ever be one h1 on a page” that what I thought. If SimpleTOC ignores the h1 headings then there are still at least one h1 heading additional to the title of the website. They would just be excluded from the SimpleTOC but still appear on the page itself.

    But I will look into option 1.

    Thread Starter Jon Schroeder

    (@jonschr)

    On a lot of sites that I build, there’s a custom h1 that gets added *instead* of the page title, so I still just have one h1 on the page (this is for formatting and to make more full use of Gutenberg), but it interacts poorly with your awesome plugin!

    To clarify option 2 – I’m meaning in terms of markup order, as typically you’d want TOC to only show headings that fall after the TOC in the markup.

    Thanks for the quick response and for looking into it! I can style around it if needed, but it would be much cleaner to not be hiding the parent element (the stand-in for the h1) in the markup.

    Plugin Author Marc Toensing

    (@marcdk)

    I have looked into it. Right now I won’t add custom heading to the SimpleTOCs processing. The reason is that it would make everything a whole lot more complicated l and I want to keep the plug-in simple.

    Thread Starter Jon Schroeder

    (@jonschr)

    Perfectly fine – but I’m not sure what you mean by “custom headings.” It would actually work just fine if (just like your “maximum heading level”) there was a “minimum heading level” the user could specify.

    Plugin Author Marc Toensing

    (@marcdk)

    I confused this post with the other on. Sorry. I am still looking into this one.

    Plugin Author Marc Toensing

    (@marcdk)

    Thread Starter Jon Schroeder

    (@jonschr)

    You could probably use just two hidden number inputs with a div, but yeesh, how does Gutenberg not have a component for this?

    Plugin Author Marc Toensing

    (@marcdk)

    Yes, right? Unbelievable. I want to keep the code as easy as possible to make it easy to maintain. No custom code that does not work on IE similar issues.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Disable h1 links’ is closed to new replies.