Skip to content

Commit

Permalink
Fix #3233 -- Simple theme classless semantic HTML
Browse files Browse the repository at this point in the history
  • Loading branch information
pauloxnet committed Nov 11, 2023
1 parent d7015db commit 6059675
Show file tree
Hide file tree
Showing 27 changed files with 163 additions and 119 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ samples/output
*.pem
*.lock
.pdm-python
.venv
6 changes: 6 additions & 0 deletions docs/settings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1231,6 +1231,12 @@ Following are example ways to specify your preferred theme::
# Specify a customized theme, via absolute path
THEME = "/home/myuser/projects/mysite/themes/mycustomtheme"

The built-in ``simple`` theme can be customized using the following settings.

.. data:: STYLESHEET_URL

The URL of the stylesheet to use.

The built-in ``notmyidea`` theme can make good use of the following settings.
Feel free to use them in your themes as well.

Expand Down
12 changes: 7 additions & 5 deletions pelican/tests/output/custom/author/alexis-metaireau.html
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,13 @@ <h1><a href="../article-1.html" rel="bookmark"
<p>There are <a href="../article-1.html#disqus_thread">comments</a>.</p> </div><!-- /.entry-content -->
</article></li>
</ol><!-- /#posts-list -->
<p class="paginator">
Page 1 / 3
<a href="../author/alexis-metaireau2.html">&raquo;</a>
<a href="../author/alexis-metaireau3.html">&#8649;</a>
</p>
<nav>
<ul>
<li>Page 1 / 3</li>
<li><a href="../author/alexis-metaireau2.html">&rang;</a></li>
<li><a href="../author/alexis-metaireau3.html">&Rang;</a></li>
</ul>
</nav>
</section><!-- /#content -->
<section id="extras" class="body">
<div class="blogroll">
Expand Down
16 changes: 9 additions & 7 deletions pelican/tests/output/custom/author/alexis-metaireau2.html
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,15 @@ <h2>Why not ?</h2>
<p>There are <a href="../oh-yeah.html#disqus_thread">comments</a>.</p> </div><!-- /.entry-content -->
</article></li>
</ol><!-- /#posts-list -->
<p class="paginator">
<a href="../author/alexis-metaireau.html">&#8647;</a>
<a href="../author/alexis-metaireau.html">&laquo;</a>
Page 2 / 3
<a href="../author/alexis-metaireau3.html">&raquo;</a>
<a href="../author/alexis-metaireau3.html">&#8649;</a>
</p>
<nav>
<ul>
<li><a href="../author/alexis-metaireau.html">&Lang;</a></li>
<li><a href="../author/alexis-metaireau.html">&lang;</a></li>
<li>Page 2 / 3</li>
<li><a href="../author/alexis-metaireau3.html">&rang;</a></li>
<li><a href="../author/alexis-metaireau3.html">&Rang;</a></li>
</ul>
</nav>
</section><!-- /#content -->
<section id="extras" class="body">
<div class="blogroll">
Expand Down
12 changes: 7 additions & 5 deletions pelican/tests/output/custom/author/alexis-metaireau3.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,13 @@ <h1><a href="../tag/baz.html" rel="bookmark"
<p>There are <a href="../tag/baz.html#disqus_thread">comments</a>.</p> </div><!-- /.entry-content -->
</article></li>
</ol><!-- /#posts-list -->
<p class="paginator">
<a href="../author/alexis-metaireau.html">&#8647;</a>
<a href="../author/alexis-metaireau2.html">&laquo;</a>
Page 3 / 3
</p>
<nav>
<ul>
<li><a href="../author/alexis-metaireau.html">&Lang;</a></li>
<li><a href="../author/alexis-metaireau2.html">&lang;</a></li>
<li>Page 3 / 3</li>
</ul>
</nav>
</section><!-- /#content -->
<section id="extras" class="body">
<div class="blogroll">
Expand Down
12 changes: 7 additions & 5 deletions pelican/tests/output/custom/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,13 @@ <h1><a href="./article-1.html" rel="bookmark"
<p>There are <a href="./article-1.html#disqus_thread">comments</a>.</p> </div><!-- /.entry-content -->
</article></li>
</ol><!-- /#posts-list -->
<p class="paginator">
Page 1 / 3
<a href="./index2.html">&raquo;</a>
<a href="./index3.html">&#8649;</a>
</p>
<nav>
<ul>
<li>Page 1 / 3</li>
<li><a href="./index2.html">&rang;</a></li>
<li><a href="./index3.html">&Rang;</a></li>
</ul>
</nav>
</section><!-- /#content -->
<section id="extras" class="body">
<div class="blogroll">
Expand Down
16 changes: 9 additions & 7 deletions pelican/tests/output/custom/index2.html
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,15 @@ <h2>Why not ?</h2>
<p>There are <a href="./oh-yeah.html#disqus_thread">comments</a>.</p> </div><!-- /.entry-content -->
</article></li>
</ol><!-- /#posts-list -->
<p class="paginator">
<a href="./index.html">&#8647;</a>
<a href="./index.html">&laquo;</a>
Page 2 / 3
<a href="./index3.html">&raquo;</a>
<a href="./index3.html">&#8649;</a>
</p>
<nav>
<ul>
<li><a href="./index.html">&Lang;</a></li>
<li><a href="./index.html">&lang;</a></li>
<li>Page 2 / 3</li>
<li><a href="./index3.html">&rang;</a></li>
<li><a href="./index3.html">&Rang;</a></li>
</ul>
</nav>
</section><!-- /#content -->
<section id="extras" class="body">
<div class="blogroll">
Expand Down
12 changes: 7 additions & 5 deletions pelican/tests/output/custom/index3.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,13 @@ <h1><a href="./tag/baz.html" rel="bookmark"
<p>There are <a href="./tag/baz.html#disqus_thread">comments</a>.</p> </div><!-- /.entry-content -->
</article></li>
</ol><!-- /#posts-list -->
<p class="paginator">
<a href="./index.html">&#8647;</a>
<a href="./index2.html">&laquo;</a>
Page 3 / 3
</p>
<nav>
<ul>
<li><a href="./index.html">&Lang;</a></li>
<li><a href="./index2.html">&lang;</a></li>
<li>Page 3 / 3</li>
</ul>
</nav>
</section><!-- /#content -->
<section id="extras" class="body">
<div class="blogroll">
Expand Down
12 changes: 7 additions & 5 deletions pelican/tests/output/custom_locale/author/alexis-metaireau.html
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,13 @@ <h1><a href="../posts/2011/février/17/article-1/" rel="bookmark"
<p>There are <a href="../posts/2011/février/17/article-1/#disqus_thread">comments</a>.</p> </div><!-- /.entry-content -->
</article></li>
</ol><!-- /#posts-list -->
<p class="paginator">
Page 1 / 3
<a href="../author/alexis-metaireau2.html">&raquo;</a>
<a href="../author/alexis-metaireau3.html">&#8649;</a>
</p>
<nav>
<ul>
<li>Page 1 / 3</li>
<li><a href="../author/alexis-metaireau2.html">&rang;</a></li>
<li><a href="../author/alexis-metaireau3.html">&Rang;</a></li>
</ul>
</nav>
</section><!-- /#content -->
<section id="extras" class="body">
<div class="blogroll">
Expand Down
16 changes: 9 additions & 7 deletions pelican/tests/output/custom_locale/author/alexis-metaireau2.html
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,15 @@ <h2>Why not ?</h2>
<p>There are <a href="../posts/2010/octobre/20/oh-yeah/#disqus_thread">comments</a>.</p> </div><!-- /.entry-content -->
</article></li>
</ol><!-- /#posts-list -->
<p class="paginator">
<a href="../author/alexis-metaireau.html">&#8647;</a>
<a href="../author/alexis-metaireau.html">&laquo;</a>
Page 2 / 3
<a href="../author/alexis-metaireau3.html">&raquo;</a>
<a href="../author/alexis-metaireau3.html">&#8649;</a>
</p>
<nav>
<ul>
<li><a href="../author/alexis-metaireau.html">&Lang;</a></li>
<li><a href="../author/alexis-metaireau.html">&lang;</a></li>
<li>Page 2 / 3</li>
<li><a href="../author/alexis-metaireau3.html">&rang;</a></li>
<li><a href="../author/alexis-metaireau3.html">&Rang;</a></li>
</ul>
</nav>
</section><!-- /#content -->
<section id="extras" class="body">
<div class="blogroll">
Expand Down
12 changes: 7 additions & 5 deletions pelican/tests/output/custom_locale/author/alexis-metaireau3.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,13 @@ <h1><a href="../tag/baz.html" rel="bookmark"
<p>There are <a href="../tag/baz.html#disqus_thread">comments</a>.</p> </div><!-- /.entry-content -->
</article></li>
</ol><!-- /#posts-list -->
<p class="paginator">
<a href="../author/alexis-metaireau.html">&#8647;</a>
<a href="../author/alexis-metaireau2.html">&laquo;</a>
Page 3 / 3
</p>
<nav>
<ul>
<li><a href="../author/alexis-metaireau.html">&Lang;</a></li>
<li><a href="../author/alexis-metaireau2.html">&lang;</a></li>
<li>Page 3 / 3</li>
</ul>
</nav>
</section><!-- /#content -->
<section id="extras" class="body">
<div class="blogroll">
Expand Down
12 changes: 7 additions & 5 deletions pelican/tests/output/custom_locale/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,13 @@ <h1><a href="./posts/2011/février/17/article-1/" rel="bookmark"
<p>There are <a href="./posts/2011/février/17/article-1/#disqus_thread">comments</a>.</p> </div><!-- /.entry-content -->
</article></li>
</ol><!-- /#posts-list -->
<p class="paginator">
Page 1 / 3
<a href="./index2.html">&raquo;</a>
<a href="./index3.html">&#8649;</a>
</p>
<nav>
<ul>
<li>Page 1 / 3</li>
<li><a href="./index2.html">&rang;</a></li>
<li><a href="./index3.html">&Rang;</a></li>
</ul>
</nav>
</section><!-- /#content -->
<section id="extras" class="body">
<div class="blogroll">
Expand Down
16 changes: 9 additions & 7 deletions pelican/tests/output/custom_locale/index2.html
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,15 @@ <h2>Why not ?</h2>
<p>There are <a href="./posts/2010/octobre/20/oh-yeah/#disqus_thread">comments</a>.</p> </div><!-- /.entry-content -->
</article></li>
</ol><!-- /#posts-list -->
<p class="paginator">
<a href="./index.html">&#8647;</a>
<a href="./index.html">&laquo;</a>
Page 2 / 3
<a href="./index3.html">&raquo;</a>
<a href="./index3.html">&#8649;</a>
</p>
<nav>
<ul>
<li><a href="./index.html">&Lang;</a></li>
<li><a href="./index.html">&lang;</a></li>
<li>Page 2 / 3</li>
<li><a href="./index3.html">&rang;</a></li>
<li><a href="./index3.html">&Rang;</a></li>
</ul>
</nav>
</section><!-- /#content -->
<section id="extras" class="body">
<div class="blogroll">
Expand Down
12 changes: 7 additions & 5 deletions pelican/tests/output/custom_locale/index3.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,13 @@ <h1><a href="./tag/baz.html" rel="bookmark"
<p>There are <a href="./tag/baz.html#disqus_thread">comments</a>.</p> </div><!-- /.entry-content -->
</article></li>
</ol><!-- /#posts-list -->
<p class="paginator">
<a href="./index.html">&#8647;</a>
<a href="./index2.html">&laquo;</a>
Page 3 / 3
</p>
<nav>
<ul>
<li><a href="./index.html">&Lang;</a></li>
<li><a href="./index2.html">&lang;</a></li>
<li>Page 3 / 3</li>
</ul>
</nav>
</section><!-- /#content -->
<section id="extras" class="body">
<div class="blogroll">
Expand Down
2 changes: 1 addition & 1 deletion pelican/themes/simple/templates/archives.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% block title %}{{ SITENAME|striptags }} - Archives{% endblock %}

{% block content %}
<h1>Archives for {{ SITENAME }}</h1>
<h2>Archives for {{ SITENAME }}</h2>

<dl>
{% for article in dates %}
Expand Down
32 changes: 16 additions & 16 deletions pelican/themes/simple/templates/article.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,44 +22,44 @@
{% endblock %}

{% block content %}
<article>
<header>
<h1 class="entry-title">
<h2>
<a href="{{ SITEURL }}/{{ article.url }}" rel="bookmark"
title="Permalink to {{ article.title|striptags }}">{{ article.title }}</a></h1>
title="Permalink to {{ article.title|striptags }}">{{ article.title }}</a></h2>
{% import 'translations.html' as translations with context %}
{{ translations.translations_for(article) }}
</header>
<footer class="post-info">
<time class="published" datetime="{{ article.date.isoformat() }}">
{{ article.content }}
<footer>
<p>Published: <time datetime="{{ article.date.isoformat() }}">
{{ article.locale_date }}
</time>
</time></p>
{% if article.modified %}
<time class="modified" datetime="{{ article.modified.isoformat() }}">
<p>Last updated: <time datetime="{{ article.modified.isoformat() }}">
{{ article.locale_modified }}
</time>
</time></p>
{% endif %}
{% if article.authors %}
<address class="vcard author">
<address>
By {% for author in article.authors %}
<a class="url fn" href="{{ SITEURL }}/{{ author.url }}">{{ author }}</a>
<a href="{{ SITEURL }}/{{ author.url }}">{{ author }}</a>
{% endfor %}
</address>
{% endif %}
{% if article.category %}
<div class="category">
<p>
Category: <a href="{{ SITEURL }}/{{ article.category.url }}">{{ article.category }}</a>
</div>
</p>
{% endif %}
{% if article.tags %}
<div class="tags">
<p>
Tags:
{% for tag in article.tags %}
<a href="{{ SITEURL }}/{{ tag.url }}">{{ tag }}</a>
{% endfor %}
</div>
</p>
{% endif %}
</footer><!-- /.post-info -->
<article>
{{ article.content }}
</footer>
</article>
{% endblock %}
2 changes: 1 addition & 1 deletion pelican/themes/simple/templates/author.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
{% block title %}{{ SITENAME|striptags }} - Articles by {{ author }}{% endblock %}

{% block content_title %}
<h1>Articles by {{ author }}</h1>
<h2>Articles by {{ author }}</h2>
{% endblock %}
2 changes: 1 addition & 1 deletion pelican/themes/simple/templates/authors.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% block title %}{{ SITENAME|striptags }} - Authors{% endblock %}

{% block content %}
<h1>Authors on {{ SITENAME }}</h1>
<h2>Authors on {{ SITENAME }}</h2>
<ul>
{% for author, articles in authors|sort %}
<li><a href="{{ SITEURL }}/{{ author.url }}">{{ author }}</a> ({{ articles|count }})</li>
Expand Down
18 changes: 12 additions & 6 deletions pelican/themes/simple/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
<meta charset="utf-8" />
<meta name="generator" content="Pelican" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
{% if SITESUBTITLE %}
<meta name="description" content="{{ SITESUBTITLE }}" />
{% endif %}
{% if STYLESHEET_URL %}
<link rel="stylesheet" type="text/css" href="{{ STYLESHEET_URL }}" />
{% endif %}
{% if FEED_ALL_ATOM %}
<link href="{{ FEED_DOMAIN }}/{% if FEED_ALL_ATOM_URL %}{{ FEED_ALL_ATOM_URL }}{% else %}{{ FEED_ALL_ATOM }}{% endif %}" type="application/atom+xml" rel="alternate" title="{{ SITENAME|striptags }} Full Atom Feed" />
{% endif %}
Expand Down Expand Up @@ -35,32 +41,32 @@

<body>
<header>
<h1><a href="{{ SITEURL }}/">{{ SITENAME }}{% if SITESUBTITLE %} <strong>{{ SITESUBTITLE }}</strong>{% endif %}</a></h1>
</header>
<hgroup><h1><a href="{{ SITEURL }}/">{{ SITENAME }}</a></h1>{% if SITESUBTITLE %}<p>{{ SITESUBTITLE }}</p>{% endif %}</hgroup>
<nav><ul>
{% for title, link in MENUITEMS %}
<li><a href="{{ link }}">{{ title }}</a></li>
{% endfor %}
{% if DISPLAY_PAGES_ON_MENU %}
{% for p in pages %}
<li{% if p == page %} class="active"{% endif %}><a href="{{ SITEURL }}/{{ p.url }}">{{ p.title }}</a></li>
<li><a href="{{ SITEURL }}/{{ p.url }}" {% if p==page %} aria-current="page" {% endif %}>{{ p.title }}</a></li>
{% endfor %}
{% endif %}
{% if DISPLAY_CATEGORIES_ON_MENU %}
{% for cat, null in categories %}
<li{% if cat == category %} class="active"{% endif %}><a href="{{ SITEURL }}/{{ cat.url }}">{{ cat }}</a></li>
<li><a href="{{ SITEURL }}/{{ cat.url }}" {% if cat==category %} aria-current="page" {% endif %}>{{ cat}}</a></li>
{% endfor %}
{% endif %}
</ul></nav>
</header>
<main>
{% block content %}
{% endblock %}
</main>
<footer>
<address id="about" class="vcard body">
<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><!-- /#about -->
</address>
</footer>
</body>
</html>

0 comments on commit 6059675

Please sign in to comment.