Skip to content
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

Simple theme fixes #2976

Merged
merged 5 commits into from
Aug 4, 2022
Merged

Simple theme fixes #2976

merged 5 commits into from
Aug 4, 2022

Conversation

pieqq
Copy link
Contributor

@pieqq pieqq commented Jan 17, 2022

A set of changes for the simple theme to be mobile-friendly and to use h1 consistently throughout the template files. Please check individual commit messages for more info.

In the simple theme, some templates are using `h1`, others are using
`h2` for the main title of the page (other than the one in the header).
This commit changes that so all of the pages are using `h1`.
Add a <main> tag to surround all the content blocks, so that it's easier
to target the main part of a page (be it an article, the list of posts
or the different categories) using CSS.

Because of this, the <section> part of the article.html template is made
redundant, so it is removed.

Finally, the generic <div> is replaced by an <article> tag to surround
the article's content.
@pauloxnet
Copy link
Member

LGTM.
Do you think there would be other html5 syntax to integrate into the 'simple' template?

@pieqq
Copy link
Contributor Author

pieqq commented Jan 17, 2022

I think it's already using a lot of HTML5 tags (header, footer, section, time to name a few).

One comment I have is that the templates are using a lot of id and class that I don't necessarily find very useful by default (especially since the simple theme comes with no CSS). For instance, in base.html:

<body id="index" class="home">
        <header id="banner" class="body">
(...)
        <footer id="contentinfo" class="body">

I don't really see the point of the body class, nor the index id. But I'm not sure if I should go ahead and change this, since I don't know how this theme is being used by others.

@pauloxnet
Copy link
Member

I agree with your perplexity about the presence of a lot of id and class since there is no CSS in simple theme.

@pieqq
Copy link
Contributor Author

pieqq commented Jan 17, 2022

So do you think I should rework this as well? I can trim a lot of things, since a lot of tags can be targeted by a specific CSS rule without having to rely on a specific id or class...

@pauloxnet
Copy link
Member

Yes, from my point of view, but I think it would be better to seek the advice of other core developers

@pieqq
Copy link
Contributor Author

pieqq commented Jan 17, 2022

OK, then I'll wait for others to comment on this and take action, if any :)

@pieqq
Copy link
Contributor Author

pieqq commented Jan 22, 2022

I went ahead and made some modifications to the base.html template. I think the rest is fine.

@pauloxnet
Copy link
Member

LGTM

All of the modified HTML tags can be accessed in CSS without the need
for a dedicated id or an additional class.
@pieqq
Copy link
Contributor Author

pieqq commented Feb 20, 2022

I've rebased this branch onto master. Not sure if this can be merged now?

<header>
<h2 class="entry-title">
<h1 class="entry-title">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we're moving simple theme to a classless theme we can remove also this class and all the others.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I decided to leave this class because in the base.html also has an <h1> tag within a <header> tag, so I thought it would still be easier to target the entry title using a dedicated class in CSS. What do you think?

@justinmayer
Copy link
Member

Thanks for the enhancements and your patience, Pierre. Much appreciated!

Kudos also to @pauloxnet for the help with reviewing. 👏

@justinmayer justinmayer merged commit e265deb into getpelican:master Aug 4, 2022
</header><!-- /#banner -->
<nav id="menu"><ul>
</header>
<nav><ul>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes like this one will break websites that extend the Simple theme; what was the motivation?

@cpitclaudel
Copy link
Contributor

I don't really see the point of the body class, nor the index id.

Many websites extend the Simple theme and add their own CSS; removing these will break them. Was anything gained in the removal?

@justinmayer
Copy link
Member

@cpitclaudel: Avoiding disruption for existing users is a priority for us. Rather than speaking in theoretical terms, could you point us to specific sites that have been affected by this change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants