diff options
author | Vincent Douillet <vincent@vdouillet.fr> | 2021-09-04 21:38:06 +0200 |
---|---|---|
committer | Vincent Douillet <vincent@vdouillet.fr> | 2021-09-04 21:38:06 +0200 |
commit | e78dd2f6212bfbd293b98e4278ead77d5ab70984 (patch) | |
tree | 014b9fcafd4f49875eedd24f48b55f25825fef06 |
Initial commit
-rw-r--r-- | README.md | 3 | ||||
-rw-r--r-- | static/css/style.css | 84 | ||||
-rw-r--r-- | templates/article.html | 60 | ||||
-rw-r--r-- | templates/base.html | 64 | ||||
-rw-r--r-- | templates/index.html | 20 |
5 files changed, 231 insertions, 0 deletions
diff --git a/README.md b/README.md new file mode 100644 index 0000000..47a578e --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# pelican-minimal + +Minimal theme for the pelican static site generator base on the default "simple" theme. diff --git a/static/css/style.css b/static/css/style.css new file mode 100644 index 0000000..2e26b99 --- /dev/null +++ b/static/css/style.css @@ -0,0 +1,84 @@ +body { + margin: auto; + padding: 0 2%; + max-width: 60em; + font-family: Arial, sans-serif; +} + +a { + color: #1f15aa; +} + +a:visited { + color: #752d77; +} + +#banner a:link, +#banner a:visited, +#banner a:hover, +#menu a:link, +#menu a:visited, +#menu a:hover, +header a, +header a:visited, +header a:hover { + color: black; + text-decoration: none; +} + +footer.post-info, +footer.copyright { + font-size: 0.8em; + color: #595959; +} + +footer.copyright { + text-align: center; +} + +#menu ul { + list-style: none; + padding-left: 0; +} + +#menu li { + display: inline; +} + +#menu li + li::before { + content: " | "; +} + +@media(prefers-color-scheme: light) { + html { + background: #efeee3; + } +} + +@media(prefers-color-scheme: dark) { + html { + background: #232323; + color: lightgrey; + } + a { + color: #7d74ff; + } + a:visited { + color: #b369b5; + } + #banner a:link, + #banner a:visited, + #banner a:hover, + #menu a:link, + #menu a:visited, + #menu a:hover, + header a, + header a:visited, + header a:hover { + color: lightgrey; + } + footer.post-info, + footer.copyright { + color: #b0b0b0; + } +} diff --git a/templates/article.html b/templates/article.html new file mode 100644 index 0000000..0ecb737 --- /dev/null +++ b/templates/article.html @@ -0,0 +1,60 @@ +{% extends "base.html" %} +{% block html_lang %}{{ article.lang }}{% endblock %} + +{% block title %}{{ SITENAME }} - {{ article.title }}{% endblock %} + +{% block head %} + {{ super() }} + + {% import 'translations.html' as translations with context %} + {% if translations.entry_hreflang(article) %} + {{ translations.entry_hreflang(article) }} + {% endif %} + + {% if article.description %} + <meta name="description" content="{{article.description}}" /> + {% endif %} + + {% for tag in article.tags %} + <meta name="tags" content="{{tag}}" /> + {% endfor %} + +{% endblock %} + +{% block content %} +<section id="content" class="body"> + <header> + <h2 class="entry-title"> + <a href="{{ SITEURL }}/{{ article.url }}" rel="bookmark" + 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"> + Publié le + <time class="published" datetime="{{ article.date }}"> + {{ article.locale_date }} + </time> + {% if article.modified %} + et modifié le + <time class="modified" datetime="{{ article.modified.isoformat() }}"> + {{ article.locale_modified }} + </time> + {% endif %} + {% if article.category %} + dans la catégorie <a href="{{ SITEURL }}/{{ article.category.url }}">{{ article.category }}</a> + {% endif %} + {% if article.tags %} + <div class="tags"> + Tags: + {% for tag in article.tags %} + <a href="{{ SITEURL }}/{{ tag.url }}">{{ tag }}</a> + {% endfor %} + </div> + {% endif %} + </footer><!-- /.post-info --> + <div class="entry-content"> + {{ article.content }} + </div><!-- /.entry-content --> +</section> +{% endblock %} diff --git a/templates/base.html b/templates/base.html new file mode 100644 index 0000000..efb4fca --- /dev/null +++ b/templates/base.html @@ -0,0 +1,64 @@ +<!DOCTYPE html> +<html lang="{% block html_lang %}{{ DEFAULT_LANG }}{% endblock html_lang %}"> +<head> + {% block head %} + <title>{% block title %}{{ SITENAME }}{% endblock title %}</title> + <meta charset="utf-8" /> + {% 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 }} Full Atom Feed" /> + {% endif %} + {% if FEED_ALL_RSS %} + <link href="{{ FEED_DOMAIN }}/{% if FEED_ALL_RSS_URL %}{{ FEED_ALL_RSS_URL }}{% else %}{{ FEED_ALL_RSS }}{% endif %}" type="application/rss+xml" rel="alternate" title="{{ SITENAME }} Full RSS Feed" /> + {% endif %} + {% if FEED_ATOM %} + <link href="{{ FEED_DOMAIN }}/{%if FEED_ATOM_URL %}{{ FEED_ATOM_URL }}{% else %}{{ FEED_ATOM }}{% endif %}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} Atom Feed" /> + {% endif %} + {% if FEED_RSS %} + <link href="{{ FEED_DOMAIN }}/{% if FEED_RSS_URL %}{{ FEED_RSS_URL }}{% else %}{{ FEED_RSS }}{% endif %}" type="application/rss+xml" rel="alternate" title="{{ SITENAME }} RSS Feed" /> + {% endif %} + {% if CATEGORY_FEED_ATOM and category %} + <link href="{{ FEED_DOMAIN }}/{% if CATEGORY_FEED_ATOM_URL %}{{ CATEGORY_FEED_ATOM_URL|format(category.slug) }}{% else %}{{ CATEGORY_FEED_ATOM|format(category.slug) }}{% endif %}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} Categories Atom Feed" /> + {% endif %} + {% if CATEGORY_FEED_RSS and category %} + <link href="{{ FEED_DOMAIN }}/{% if CATEGORY_FEED_RSS_URL %}{{ CATEGORY_FEED_RSS_URL|format(category.slug) }}{% else %}{{ CATEGORY_FEED_RSS|format(category.slug) }}{% endif %}" type="application/rss+xml" rel="alternate" title="{{ SITENAME }} Categories RSS Feed" /> + {% endif %} + {% if TAG_FEED_ATOM and tag %} + <link href="{{ FEED_DOMAIN }}/{% if TAG_FEED_ATOM_URL %}{{ TAG_FEED_ATOM_URL|format(tag.slug) }}{% else %}{{ TAG_FEED_ATOM|format(tag.slug) }}{% endif %}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} Tags Atom Feed" /> + {% endif %} + {% if TAG_FEED_RSS and tag %} + <link href="{{ FEED_DOMAIN }}/{% if TAG_FEED_RSS_URL %}{{ TAG_FEED_RSS_URL|format(tag.slug) }}{% else %}{{ TAG_FEED_RSS|format(tag.slug) }}{% endif %}" type="application/rss+xml" rel="alternate" title="{{ SITENAME }} Tags RSS Feed" /> + {% endif %} + <link rel="stylesheet" type="text/css" href="{{ SITEURL }}/theme/css/style.css" /> + {% endblock head %} +</head> + +<body id="index" class="home"> + <header id="banner" class="body"> + <h1><a href="{{ SITEURL }}/">{{ SITENAME }}</a></h1> + <h2 id="sitesubtitle">{{ SITESUBTITLE }}</h2> + </header><!-- /#banner --> + <nav id="menu"><ul> + {% for title, link in MENUITEMS %} + <li><a href="{{ link }}">{{ title }}</a></li> + {% endfor %} + {% 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> + {% endfor %} + {% endif %} + {% 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> + {% endfor %} + {% endif %} + </ul></nav><!-- /#menu --> + <hr /> + {% block content %} + {% endblock %} + + <hr /> + <footer id="contentinfo" class="body copyright"> + Copyright © Vincent Douillet. Licence <a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA 4.0</a> <a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by-sa/4.0/80x15.png" /></a> + </footer><!-- /#contentinfo --> +</body> +</html> diff --git a/templates/index.html b/templates/index.html new file mode 100644 index 0000000..a020bb1 --- /dev/null +++ b/templates/index.html @@ -0,0 +1,20 @@ +{% extends "base.html" %} +{% block content %} +<section id="content"> +{% block content_title %} +{% endblock %} + +{% for article in articles_page.object_list %} + <article class="hentry"> + <header> <h2 class="entry-title"><a href="{{ SITEURL }}/{{ article.url }}" rel="bookmark" title="Permalink to {{ article.title|striptags }}">{{ article.title }}</a></h2> </header> + <div class="entry-content"> {{ article.summary }} </div><!-- /.entry-content --> + <footer class="post-info"> + <time class="published" datetime="{{ article.date.isoformat() }}"> {{ article.locale_date }} </time> + </footer><!-- /.post-info --> + </article> +{% endfor %} +{% if articles_page.has_other_pages() %} + {% include 'pagination.html' %} +{% endif %} +</section><!-- /#content --> +{% endblock content %} |