-
Notifications
You must be signed in to change notification settings - Fork 456
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generated front page contains one <h1>
for each post, I wish they were <h2>
#3708
Comments
Iirc both options are only used in headings of the bodies of posts. I do agree with this sentiment, but this creates another problem, what about posts with subheadings? How do we accomodate both "headings should be hierarchical" and "only one h1 per page"? |
A fair question. I had imagined, when I saw the conf.py options to demote headings, that they would demote all headings by the same amount. Hence h2 would become h3, and the max (h7?) would become a standalone para of regular text. Presumably though, this question is independent of the issue I'm raising. The demotion of sub-headers is "handle demotion correctly", and needs to be done right on individual posts too, while this issue is "apply the demotion on the front page as well as individual posts." |
This single- If you want to follow this rule, you would need to change your templates so that there is a |
Thanks for the input. FWIW I mis-spoke earlier - Bing webmaster tools produces an error about the multiple h1 tags, but once I cleared up other errors, it will now index the page. So this doesn't block indexing after all. |
Environment
Python Version: 3.10.12
Nikola Version: 8.2.4
Operating System: Pop!_OS 22.04 (derived from Ubuntu 22.04)
Description
My generated front page has several
<h1>
tags in it, one for each included post. I want them to be<h2>
tags instead.Only using a single
<h1>
is recommended as a best practice (e.g. here in Mozilla developer network). In particular, I'm trying to register my Nikola site with Bing webmaster tools, so that it will get indexed and appear in search results. To be indexed, a page must only have at most one<h1>
tag. So I can't get my front page indexed.I tried editing my conf.py, uncommenting either
PANDOC_OPTIONS = ['--base-header-level=2']
, orDEMOTE_HEADERS = 1
, but this has not had any effect.(Incidentally, grepping the code for 'DEMOTE_HEADERS' only finds this instance. Is this option currently used?)
The text was updated successfully, but these errors were encountered: