-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Pelican 4.9's simple
theme uses <h2>
inconsistently
#3389
Comments
@pauloxnet: Any thoughts on this issue related to one of your previous PRs? |
Sorry, I've missed that one. Your examples are missing the full generated html. This is an example post I put in a Pelican generated project that uses the simple theme. Title: Hello World!
Date: 2024-09-12 15:00
Category: Article
### Lorem ipsum
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim aeque doleamus animo, cum corpore dolemus, fieri tamen. This is the html generated by Pelican (I reformatted it to paste here): <!DOCTYPE html>
<html lang="en">
<head>
<title>paulox - Hello World!</title>
<meta charset="utf-8" />
<meta name="generator" content="Pelican" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<header>
<hgroup>
<h1><a href="/">paulox</a></h1>
</hgroup>
<nav>
<ul>
<li><a href="/category/article.html" aria-current="page">Article</a></li>
</ul>
</nav>
</header>
<main>
<article>
<header>
<h2>
<a href="/hello-world.html" rel="bookmark" title="Permalink to Hello World!">Hello World!</a>
</h2>
</header>
<h3>Lorem ipsum</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore
magnam aliquam quaerat voluptatem. Ut enim aeque doleamus animo, cum corpore dolemus, fieri tamen.</p>
<footer>
<p>Published: <time datetime="2024-09-12T15:00:00+02:00">
gio 12 settembre 2024
</time></p>
<address>
By <a href="/author/paolo-melchiorre.html">Paolo Melchiorre</a>
</address>
<p>
Category: <a href="/category/article.html">Article</a>
</p>
</footer>
</article>
</main>
<footer>
<address>
Proudly powered by <a rel="nofollow" href="https://getpelican.com/">Pelican</a>,
which takes great advantage of <a rel="nofollow" href="https://www.python.org/">Python</a>.
</address>
</footer>
</body>
</html> As you can see there is an Best practice is to not use In the simple theme, the site title is in The headers in the simple theme are consistent and follow the best practices above, but if you want a different result I recommend creating a new theme rather than modifying the simple theme which is intended as a starting point. P.S. I hope I've made it clear, unfortunately I won't have time to follow up on this issue in the next few days so I might not respond before October. |
Thanks for your reply! I this there was a misunderstanding. You write "In the simple theme, the site title is in h1, the post title is consequently in h2 and therefore the paragraph titles you should use in a post should be h3, h4, h5 or h6, if you want to be consistent from an accessibility point of view.", but unfortunately I don't think this works:
It seems like the "right" solution would be to remove the |
I have read the Filing Issues and subsequent “How to Get Help” sections of the documentation.
I have searched the issues (including closed ones) and believe that this is not a duplicate.
OS version and name: Ubuntu 22.04.4 LTS
Python version: Python 3.10.12
Pelican version: 4.9.1
Link to theme:
simple
Links to plugins: None
Issue
In #3234 some
<h1>
s were changed to<h2>
s, but the results are not consistent. In fe4f1ec titles were made to be uniformlyh1
s; then in #3234 part of the change was reverted.All articles
changed back fromh1
toh2
, but individual article titles remainedh2
sh2
is inconsistent with other themes, especiallynotmyidea
h2
s. In 4.8 this problem existed with articles but not pages (see repro below), and it was fixed in fe4f1ec and then reverted in Fix #3233 -- Simple theme classless semantic HTML #3234 (both happened before 4.9).Here is a minimal article and how Pelican compiles it:
Generated HTML:
In contrast, here is the HTML produced by the
notmyidea
, which consistently uses h1, h2, and h3:(Pages have the same issue, whereas before it was only articles.)
CC @pauloxnet
The text was updated successfully, but these errors were encountered: