chiark / gitweb /
Initial version of the Pelican theme.
authorVladimír Vondruš <mosra@centrum.cz>
Tue, 4 Jul 2017 09:20:08 +0000 (11:20 +0200)
committerVladimír Vondruš <mosra@centrum.cz>
Wed, 5 Jul 2017 23:02:08 +0000 (01:02 +0200)
20 files changed:
pelican-theme/static/inc/m-components.css [new symlink]
pelican-theme/static/inc/m-dark.css [new symlink]
pelican-theme/static/inc/m-debug.css [new symlink]
pelican-theme/static/inc/m-grid.css [new symlink]
pelican-theme/static/inc/m-light.css [new symlink]
pelican-theme/static/inc/pygments-dark.css [new symlink]
pelican-theme/templates/.kateconfig [new file with mode: 0644]
pelican-theme/templates/archives.html [new file with mode: 0644]
pelican-theme/templates/article.html [new file with mode: 0644]
pelican-theme/templates/article_footer.html [new file with mode: 0644]
pelican-theme/templates/article_header.html [new file with mode: 0644]
pelican-theme/templates/author.html [new file with mode: 0644]
pelican-theme/templates/base.html [new file with mode: 0644]
pelican-theme/templates/base_blog.html [new file with mode: 0644]
pelican-theme/templates/base_blog_section.html [new file with mode: 0644]
pelican-theme/templates/category.html [new file with mode: 0644]
pelican-theme/templates/index.html [new file with mode: 0644]
pelican-theme/templates/page.html [new file with mode: 0644]
pelican-theme/templates/pagination.html [new file with mode: 0644]
pelican-theme/templates/tag.html [new file with mode: 0644]

diff --git a/pelican-theme/static/inc/m-components.css b/pelican-theme/static/inc/m-components.css
new file mode 120000 (symlink)
index 0000000..74118bd
--- /dev/null
@@ -0,0 +1 @@
+../../../css/m-components.css
\ No newline at end of file
diff --git a/pelican-theme/static/inc/m-dark.css b/pelican-theme/static/inc/m-dark.css
new file mode 120000 (symlink)
index 0000000..259c177
--- /dev/null
@@ -0,0 +1 @@
+../../../css/m-dark.css
\ No newline at end of file
diff --git a/pelican-theme/static/inc/m-debug.css b/pelican-theme/static/inc/m-debug.css
new file mode 120000 (symlink)
index 0000000..f531451
--- /dev/null
@@ -0,0 +1 @@
+../../../css/m-debug.css
\ No newline at end of file
diff --git a/pelican-theme/static/inc/m-grid.css b/pelican-theme/static/inc/m-grid.css
new file mode 120000 (symlink)
index 0000000..d56b15e
--- /dev/null
@@ -0,0 +1 @@
+../../../css/m-grid.css
\ No newline at end of file
diff --git a/pelican-theme/static/inc/m-light.css b/pelican-theme/static/inc/m-light.css
new file mode 120000 (symlink)
index 0000000..8762e44
--- /dev/null
@@ -0,0 +1 @@
+../../../css/m-light.css
\ No newline at end of file
diff --git a/pelican-theme/static/inc/pygments-dark.css b/pelican-theme/static/inc/pygments-dark.css
new file mode 120000 (symlink)
index 0000000..1697832
--- /dev/null
@@ -0,0 +1 @@
+../../../css/pygments-dark.css
\ No newline at end of file
diff --git a/pelican-theme/templates/.kateconfig b/pelican-theme/templates/.kateconfig
new file mode 100644 (file)
index 0000000..b46a48b
--- /dev/null
@@ -0,0 +1 @@
+// kate: indent-width 2;
diff --git a/pelican-theme/templates/archives.html b/pelican-theme/templates/archives.html
new file mode 100644 (file)
index 0000000..fe744bd
--- /dev/null
@@ -0,0 +1,23 @@
+{% extends "base_blog.html" %}
+{% block content %}
+<div class="m-col-m-10">
+  {% block content_title %}
+  {% endblock content_title %}
+  {% for article in articles_page.object_list %}
+  <article>
+    {% include "article_header.html" %}
+    {% if loop.first and articles_page.number == 1 %}
+    <div class="m-clearfix-l"></div>
+    {{ article.content }}
+    {% endif %}
+    {% include "article_footer.html" %}
+    {% if not loop.first or articles_page.number != 1 %}
+    <div class="m-clearfix-l"></div>
+    {% endif %}
+  </article>
+  {% endfor %}
+  {% if articles_page.has_other_pages() %}
+      {% include 'pagination.html' %}
+  {% endif %}
+</div>
+{% endblock content %}
diff --git a/pelican-theme/templates/article.html b/pelican-theme/templates/article.html
new file mode 100644 (file)
index 0000000..36ebfdc
--- /dev/null
@@ -0,0 +1,75 @@
+{% extends "base_blog.html" %}
+
+{% block title %}{{ article.title }} | {{ BLOGNAME }}{% endblock %}
+
+{% block head %}
+  {{- super() -}}
+  {% if article.description %}
+  <meta name="description" content="{{ article.description }}" />
+  {% endif %}
+  <meta name="keywords" content="{{ article.tags|join(", ") }}" />
+  <meta property="og:title" content="{{ article.title|striptags }}" />
+  <meta property="og:url" content="{{ article.url }}" />
+  <meta property="og:description" content="{{ article.summary|striptags }}" />
+  {% if article.cover %}
+  <meta property="og:image" content="{{ article|expand_link('cover') }}" />
+  {% endif %}
+  <meta property="og:type" content="article" />
+{% endblock %}
+
+{% block content %}
+{% if article.cover %}
+<article class="m-jumbo {{ article.class }}">
+  <header>
+    <div class="m-jumbo-image" style="background-image: url('{{ article|expand_link('cover') }}');">
+      <div class="m-jumbo-cover">
+        <div class="m-container">
+          <div class="m-row">
+            <div class="m-col-t-6 m-col-s-5 m-push-s-1 m-text-left">{{ article.locale_date }}</div>
+            <div class="m-col-t-6 m-col-s-5 m-push-s-1 m-text-right">{% for author in article.authors %}<a href="{{ author.url }}">{{ author }}</a>{% endfor %}</div>
+          </div>
+          <div class="m-row">
+            <div class="m-col-t-12 m-col-s-10 m-push-s-1 m-col-m-8 m-push-m-2">
+              {% set title = article.title.split(' &#8212; ') %}
+              <h1><a href="{{ article.url }}" rel="bookmark"
+    title="Permalink to {{ article.title|striptags }}">
+              {{ title[0] }}
+              </a></h1>
+              {% if title|length >= 2 %}<h2>{{ title[1] }}</h2>{% endif %}
+            </div>
+          </div>
+        </div>
+      </div>
+    </div>
+    <div class="m-container m-nopady">
+      <div class="m-row">
+        <div class="m-col-m-10 m-push-m-1 m-nopady">
+          {{ article.summary }}
+        </div>
+      </div>
+    </div>
+  </header>
+  <div class="m-container m-nopady" id="m-container-inflatable">
+    <div class="m-row">
+      <div class="m-col-m-10 m-push-m-1 m-nopady">
+      {{ article.content }}
+      </div>
+    </div>
+  </div>
+  <footer class="m-container m-nopady">
+    <div class="m-row">
+      <div class="m-col-m-10 m-push-m-1 m-nopady">
+        <p>Posted {% if article.authors %}by {% for author in article.authors %}<a href="{{ author.url }}">{{ author }}</a>{% endfor %}{% endif %} on <time datetime="{{ article.date.isoformat() }}">{{ article.locale_date }}</time> in <a href="{{ article.category.url }} ">{{ article.category }}</a>.{% if article.tags %} Tags: {% for tag in article.tags %}<a href="{{ tag.url }}">{{ tag }}</a>{% if not loop.last %}, {% endif %}{% endfor %}.{% endif %}</p>
+      </div>
+    </div>
+  </footer>
+</article>
+{% else %}
+<article class="m-col-m-10">
+  {% include "article_header.html" %}
+  <div class="m-clearfix-l"></div>
+  {{ article.content }}
+  {% include "article_footer.html" %}
+</article>
+{% endif %}
+{% endblock %}
diff --git a/pelican-theme/templates/article_footer.html b/pelican-theme/templates/article_footer.html
new file mode 100644 (file)
index 0000000..b69bad5
--- /dev/null
@@ -0,0 +1,3 @@
+<footer>
+  <p>Posted {% if article.authors %}by {% for author in article.authors %}<a href="{{ author.url }}">{{ author }}</a>{% endfor %}{% endif %} on <time datetime="{{ article.date.isoformat() }}">{{ article.locale_date }}</time> in <a href="{{ article.category.url }} ">{{ article.category }}</a>.{% if article.tags %} Tags: {% for tag in article.tags %}<a href="{{ tag.url }}">{{ tag }}</a>{% if not loop.last %}, {% endif %}{% endfor %}.{% endif %}</p>
+</footer>
diff --git a/pelican-theme/templates/article_header.html b/pelican-theme/templates/article_header.html
new file mode 100644 (file)
index 0000000..2349207
--- /dev/null
@@ -0,0 +1,11 @@
+<header>
+  <h1><a href="{{ article.url }}" rel="bookmark"
+  title="Permalink to {{ article.title|striptags }}">
+    <time class="m-date" datetime="{{ article.date.isoformat() }}">
+    {% set month, day, year = article.locale_date.split(' ') %}
+    {{ month }} <span class="m-date-day">{{ day }}</span> {{year}}
+    </time>
+  {{ article.title }}
+  </a></h1>
+  {{ article.summary }}
+</header>
diff --git a/pelican-theme/templates/author.html b/pelican-theme/templates/author.html
new file mode 100644 (file)
index 0000000..c69de75
--- /dev/null
@@ -0,0 +1,9 @@
+{% extends "base_blog_section.html" %}
+
+{% block title %}Posts by {{ author }} | {{ BLOGNAME }}{% endblock %}
+
+{% block content_title %}
+<div class="m-info m-note">
+  Showing only posts by <em>{{ author }}</em>. <a href="{{ BLOGURL }}/">Show all posts.</a>
+</div>
+{% endblock %}
diff --git a/pelican-theme/templates/base.html b/pelican-theme/templates/base.html
new file mode 100644 (file)
index 0000000..626c0b5
--- /dev/null
@@ -0,0 +1,143 @@
+<!DOCTYPE html>
+<html lang="{{ DEFAULT_LANG }}">
+<head>
+  {% block head %}
+  <title>{% block title %}{{ SITENAME }}{% endblock title %}</title>
+  {% for href in CSS_FILES %}
+  <link rel="stylesheet" href="{{ href }}" />
+  {% endfor %}
+  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+  <meta name="theme-color" content="{{ THEME_COLOR }}" />
+  <meta charset="UTF-8" />
+  {% if FEED_ALL_ATOM %}
+  <link href="{{ FEED_ALL_ATOM }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }}" />
+  {% endif %}
+  {% if CATEGORY_FEED_ATOM and category %}
+  <link href="{{ CATEGORY_FEED_ATOM|format(category.slug) }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} | {{ category }}" />
+  {% endif %}
+  {% endblock head %}
+</head>
+<body>
+<header>
+  <nav id="navigation">
+    <div class="m-container">
+      <div class="m-row">
+        <a href="{{ SITEURL }}/" id="m-navbar-brand" class="m-col-t-9 m-col-m-none m-left-m">
+          {% if SITE_LOGO %}<img src="{{ SITE_LOGO }}" />{% endif %}
+          {{ SITE_LOGO_TEXT }}
+        </a>
+        <a id="m-navbar-show" href="#navigation" title="Show navigation" class="m-col-t-3 m-hide-m m-right">&#9776;</a>
+        <a id="m-navbar-hide" href="#" title="Hide navigation" class="m-col-t-3 m-hide-m m-right">&#9776;</a>
+        <div id="m-navbar-collapse" class="m-col-t-12 m-show-m m-col-m-none m-right-m">
+          <div class="m-row">
+            <ol class="m-col-t-6 m-col-m-none">
+              {% for title, link, sub in LINKS_NAVBAR1 %}
+              <li>
+                <a href="{{ link }}" {% if title == page_title %}id="m-navbar-current"{% endif %}>{{ title }}</a>
+                {% if sub %}
+                <ol>
+                  {% for title, link in sub %}
+                    <li><a href="{{ link }}">{{ title }}</a></li>
+                  {% endfor %}
+                </ol>
+                {% endif %}
+              </li>
+              {% endfor %}
+            </ol>
+            <ol class="m-col-t-6 m-col-m-none">
+              {% for title, link, sub in LINKS_NAVBAR2 %}
+              <li>
+                <a href="{{ link }}" {% if title == page_title %}id="m-navbar-current"{% endif %}>{{ title }}</a>
+                {% if sub %}
+                <ol>
+                  {% for title, link in sub %}
+                    <li><a href="{{ link }}">{{ title }}</a></li>
+                  {% endfor %}
+                </ol>
+                {% endif %}
+              </li>
+              {% endfor %}
+            </ol>
+          </div>
+        </div>
+      </div>
+    </div>
+  </nav>
+</header>
+<main>
+  {% block main %}
+  {% endblock %}
+</main>
+<footer>
+  <nav>
+    <div class="m-container">
+      <div class="m-row">
+        <div class="m-col-s-3 m-col-t-6">
+          <h3>
+            {% if LINKS_FOOTER1[0][1] %}<a href="{{ LINKS_FOOTER1[0][1] }}/">{% endif %}
+            {{ LINKS_FOOTER1[0][0] }}
+            {% if LINKS_FOOTER1[0][1] %}</a>{% endif %}
+          </h3>
+          <ul>
+            {% for title, link in LINKS_FOOTER1 %}
+            {% if loop.index0 != 0 %}<li><a href="{{ link }}">{{ title }}</a></li>{% endif %}
+            {% endfor %}
+          </ul>
+        </div>
+        <div class="m-col-s-3 m-col-t-6">
+          <h3>
+            {% if LINKS_FOOTER2[0][1] %}<a href="{{ LINKS_FOOTER2[0][1] }}/">{% endif %}
+            {{ LINKS_FOOTER2[0][0] }}
+            {% if LINKS_FOOTER2[0][1] %}</a>{% endif %}
+          </h3>
+          <ul>
+            {% for title, link in LINKS_FOOTER2 %}
+            {% if loop.index0 != 0 %}<li><a href="{{ link }}">{{ title }}</a></li>{% endif %}
+            {% endfor %}
+          </ul>
+        </div>
+        <div class="m-clearfix-t"></div>
+        <div class="m-col-s-3 m-col-t-6">
+          <h3>
+            {% if LINKS_FOOTER3[0][1] %}<a href="{{ LINKS_FOOTER3[0][1] }}/">{% endif %}
+            {{ LINKS_FOOTER3[0][0] }}
+            {% if LINKS_FOOTER3[0][1] %}</a>{% endif %}
+          </h3>
+          <ul>
+            {% for title, link in LINKS_FOOTER3 %}
+            {% if loop.index0 != 0 %}<li><a href="{{ link }}">{{ title }}</a></li>{% endif %}
+            {% endfor %}
+          </ul>
+        </div>
+        <div class="m-col-s-3 m-col-t-6">
+          {% if LINKS_FOOTER4 %}
+          <h3>
+            {% if LINKS_FOOTER4[0][1] %}<a href="{{ LINKS_FOOTER4[0][1] }}/">{% endif %}
+            {{ LINKS_FOOTER4[0][0] }}
+            {% if LINKS_FOOTER4[0][1] %}</a>{% endif %}
+          </h4>
+          <ul>
+            {% for title, link in LINKS_FOOTER4 %}
+            {% if loop.index0 != 0 %}<li><a href="{{ link }}">{{ title }}</a></li>{% endif %}
+            {% endfor %}
+          </ul>
+          {% else %}
+          <h3><a href="{{ BLOGURL }}">Blog</a></h3>
+          <ul>
+            {% for cat, null in categories %}
+            <li><a href="{{ cat.url }}">{{ cat }}</a></li>
+            {% endfor %}
+          </ul>
+          {% endif %}
+        </div>
+      </div>
+      <div class="m-row">
+        <div class="m-col-l-10 m-push-l-1">
+          {{ FINE_PRINT|render_rst }}
+        </div>
+      </div>
+    </div>
+  </nav>
+</footer>
+</body>
+</html>
diff --git a/pelican-theme/templates/base_blog.html b/pelican-theme/templates/base_blog.html
new file mode 100644 (file)
index 0000000..c421ac4
--- /dev/null
@@ -0,0 +1,55 @@
+{% set page_title = 'Blog' %}
+{% extends 'base.html' %}
+
+{% block title %}{{ BLOGNAME }}{% endblock %}
+
+{% block main %}
+{% if article and article.cover %}
+{% else %}
+<div class="m-container">
+  <div class="m-row">
+{% endif %}
+{% block content %}
+{% endblock %}
+{% if article and article.cover %}
+<nav class="m-navpanel m-container">
+  <div class="m-row">
+    <div class="m-col-m-5 m-push-m-1 m-col-s-6">
+      <h3>Cate&shy;gories</h3>
+      <ol class="m-block-bar-m">
+        {% for cat, null in categories %}
+        <li><a href="{{ cat.url }}">{{ cat }}</a></li>
+        {% endfor %}
+      </ol>
+    </div>
+    <div class="m-col-m-5 m-push-m-1 m-col-s-6">
+      <h3>Tag cloud</h3>
+      <ul class="m-tagcloud">
+        {% set max_articles_per_tag = tags|map(attribute='1')|map('length')|sort|last %}
+        {% for tag, articles in tags|sort(attribute='0') %}
+        <li class="m-tag-{{ (TAG_CLOUD_LEVELS*(articles|length)/max_articles_per_tag)|round(0, 'ceil')|int }} "><a href="{{ tag.url }}">{{ tag }}</a></li>
+        {% endfor %}
+      </ul>
+    </div>
+  </div>
+</nav>
+{% else %}
+    <nav class="m-navpanel m-col-m-2">
+      <h3>Cate&shy;gories</h3>
+      <ol class="m-block-bar-m">
+        {% for cat, null in categories %}
+        <li><a href="{{ cat.url }}">{{ cat|hyphenate }}</a></li>
+        {% endfor %}
+      </ol>
+      <h3>Tag cloud</h3>
+      <ul class="m-tagcloud">
+        {% set max_articles_per_tag = tags|map(attribute='1')|map('length')|sort|last %}
+        {% for tag, articles in tags|sort(attribute='0') %}
+        <li class="m-tag-{{ (TAG_CLOUD_LEVELS*(articles|length)/max_articles_per_tag)|round(0, 'ceil')|int }} "><a href="{{ tag.url }}">{{ tag }}</a></li>
+        {% endfor %}
+      </ul>
+    </nav>
+  </div>
+</div>
+{% endif %}
+{% endblock %}
diff --git a/pelican-theme/templates/base_blog_section.html b/pelican-theme/templates/base_blog_section.html
new file mode 100644 (file)
index 0000000..45634a8
--- /dev/null
@@ -0,0 +1,16 @@
+{% extends "base_blog.html" %}
+{% block content %}
+<div class="m-col-m-10">
+  {% block content_title %}
+  {% endblock content_title %}
+  {% for article in articles_page.object_list %}
+  <article>
+    {% include "article_header.html" %}
+    {% include "article_footer.html" %}
+  </article>
+  {% endfor %}
+  {% if articles_page.has_other_pages() %}
+    {% include 'pagination.html' %}
+  {% endif %}
+</div>
+{% endblock content %}
diff --git a/pelican-theme/templates/category.html b/pelican-theme/templates/category.html
new file mode 100644 (file)
index 0000000..7c44327
--- /dev/null
@@ -0,0 +1,9 @@
+{% extends "base_blog_section.html" %}
+
+{% block title %}{{ category }} | {{ BLOGNAME }}{% endblock %}
+
+{% block content_title %}
+<div class="m-info m-note">
+  Showing only posts in <em>{{ category }}</em>. <a href="{{ BLOGURL }}/">Show all posts.</a>
+</div>
+{% endblock %}
diff --git a/pelican-theme/templates/index.html b/pelican-theme/templates/index.html
new file mode 100644 (file)
index 0000000..ee6776e
--- /dev/null
@@ -0,0 +1,3 @@
+{% extends "base.html" %}
+{% block main %}
+{% endblock %}
diff --git a/pelican-theme/templates/page.html b/pelican-theme/templates/page.html
new file mode 100644 (file)
index 0000000..b3ebd55
--- /dev/null
@@ -0,0 +1,15 @@
+{% set page_title = page.title|replace('&shy;', '') %}
+{% extends "base.html" %}
+
+{% block title %}{{ page.title }} | {{ SITENAME }}{%endblock%}
+
+{% block main %}
+<article class="m-container" id="m-container-inflatable">
+  <div class="m-row">
+    <div class="m-col-l-10 m-push-l-1">
+      <h1>{{ page.title }}</h1>
+      {{ page.content }}
+    </div>
+  </div>
+</article>
+{% endblock %}
diff --git a/pelican-theme/templates/pagination.html b/pelican-theme/templates/pagination.html
new file mode 100644 (file)
index 0000000..ecbb6df
--- /dev/null
@@ -0,0 +1,11 @@
+{% if DEFAULT_PAGINATION %}
+<div class="m-article-pagination">
+  {% if articles_page.has_previous() %}
+    <a href="{{ articles_previous_page.url }}">&laquo; newer articles</a> |
+  {% endif %}
+  page {{ articles_page.number }}
+  {% if articles_page.has_next() %}
+    | <a href="{{ articles_next_page.url }}">older articles &raquo;</a>
+  {% endif %}
+</div>
+{% endif %}
diff --git a/pelican-theme/templates/tag.html b/pelican-theme/templates/tag.html
new file mode 100644 (file)
index 0000000..24e6204
--- /dev/null
@@ -0,0 +1,9 @@
+{% extends "base_blog_section.html" %}
+
+{% block title %}Posts tagged {{ tag }} | {{ BLOGNAME }}{% endblock %}
+
+{% block content_title %}
+<div class="m-info m-note">
+  Showing only posts tagged <em>{{ tag }}</em>. <a href="{{ BLOGURL }}/">Show all posts.</a>
+</div>
+{% endblock %}