Skip to content

Simple theme fixes#2976

Merged
justinmayer merged 5 commits into
getpelican:masterfrom
pieqq:simple-theme-fixes
Aug 4, 2022
Merged

Simple theme fixes#2976
justinmayer merged 5 commits into
getpelican:masterfrom
pieqq:simple-theme-fixes

Conversation

@pieqq

@pieqq pieqq commented Jan 17, 2022

Copy link
Copy Markdown
Contributor

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.

pieqq added 3 commits January 17, 2022 16:21
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
Copy Markdown
Member

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

@pieqq

pieqq commented Jan 17, 2022

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
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

pieqq commented Jan 17, 2022

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
Member

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

@pieqq

pieqq commented Jan 17, 2022

Copy link
Copy Markdown
Contributor Author

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

@pieqq

pieqq commented Jan 22, 2022

Copy link
Copy Markdown
Contributor Author

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

@pauloxnet

Copy link
Copy Markdown
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 pieqq force-pushed the simple-theme-fixes branch from ab58bdc to 16b8a03 Compare February 20, 2022 02:30
@pieqq

pieqq commented Feb 20, 2022

Copy link
Copy Markdown
Contributor Author

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

<section id="content" class="body">
<header>
<h2 class="entry-title">
<h1 class="entry-title">

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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