Improve SEO by replacing h3 tag with div tag

Created on 4 July 2022, over 2 years ago
Updated 15 January 2025, 8 days ago

Problem/Motivation

The title of "Table of contents title" is presented with H3 structure and this is not good for a SEO hierarchy if the H1 tag is above it.

Steps to reproduce

Whenever an index is generated

Proposed resolution

Replace H3 tag with a DIV tag.

OPEN AND EDIT: modules > contrib > toc_api > templates > toc-tree.html.twig
SEARCH: h3 {{ tree.title }} /h3
REPLACE WITH: div class="toc-title" {{ tree.title }} /div

OPEN AND EDIT: modules > contrib > toc_api > css > toc.tree.css
SEARCH: .node .toc-tree {
border: 1px solid #ccc;
padding: 0 1em;
margin: 1em 0;
}
ADD BELOW: .node .toc-title {
font-size: 18px;
font-weight: bold;
}

Remaining tasks

User interface changes

API changes

Data model changes

Feature request
Status

Closed: duplicate

Version

1.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024