commit 39c9433fb15c014b4e9bc25094442424b98e5226 Author: Henner M. Kruse Date: Sun May 31 15:15:28 2020 +0200 Initial commit diff --git a/README.md b/README.md new file mode 100644 index 0000000..e894180 --- /dev/null +++ b/README.md @@ -0,0 +1,4 @@ +# Pelican LaTeX theme + +A theme for pelican which mimics the look of LaTeX documents. + diff --git a/static/css/pygment.css b/static/css/pygment.css new file mode 100644 index 0000000..572069c --- /dev/null +++ b/static/css/pygment.css @@ -0,0 +1,69 @@ +.highlight .hll { background-color: #ffffcc } +.highlight { background: #f8f8f8; } +.highlight .c { color: #408080; font-style: italic } /* Comment */ +.highlight .err { border: 1px solid #FF0000 } /* Error */ +.highlight .k { color: #008000; font-weight: bold } /* Keyword */ +.highlight .o { color: #666666 } /* Operator */ +.highlight .ch { color: #408080; font-style: italic } /* Comment.Hashbang */ +.highlight .cm { color: #408080; font-style: italic } /* Comment.Multiline */ +.highlight .cp { color: #BC7A00 } /* Comment.Preproc */ +.highlight .cpf { color: #408080; font-style: italic } /* Comment.PreprocFile */ +.highlight .c1 { color: #408080; font-style: italic } /* Comment.Single */ +.highlight .cs { color: #408080; font-style: italic } /* Comment.Special */ +.highlight .gd { color: #A00000 } /* Generic.Deleted */ +.highlight .ge { font-style: italic } /* Generic.Emph */ +.highlight .gr { color: #FF0000 } /* Generic.Error */ +.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */ +.highlight .gi { color: #00A000 } /* Generic.Inserted */ +.highlight .go { color: #888888 } /* Generic.Output */ +.highlight .gp { color: #000080; font-weight: bold } /* Generic.Prompt */ +.highlight .gs { font-weight: bold } /* Generic.Strong */ +.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ +.highlight .gt { color: #0044DD } /* Generic.Traceback */ +.highlight .kc { color: #008000; font-weight: bold } /* Keyword.Constant */ +.highlight .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */ +.highlight .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */ +.highlight .kp { color: #008000 } /* Keyword.Pseudo */ +.highlight .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */ +.highlight .kt { color: #B00040 } /* Keyword.Type */ +.highlight .m { color: #666666 } /* Literal.Number */ +.highlight .s { color: #BA2121 } /* Literal.String */ +.highlight .na { color: #7D9029 } /* Name.Attribute */ +.highlight .nb { color: #008000 } /* Name.Builtin */ +.highlight .nc { color: #0000FF; font-weight: bold } /* Name.Class */ +.highlight .no { color: #880000 } /* Name.Constant */ +.highlight .nd { color: #AA22FF } /* Name.Decorator */ +.highlight .ni { color: #999999; font-weight: bold } /* Name.Entity */ +.highlight .ne { color: #D2413A; font-weight: bold } /* Name.Exception */ +.highlight .nf { color: #0000FF } /* Name.Function */ +.highlight .nl { color: #A0A000 } /* Name.Label */ +.highlight .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */ +.highlight .nt { color: #008000; font-weight: bold } /* Name.Tag */ +.highlight .nv { color: #19177C } /* Name.Variable */ +.highlight .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */ +.highlight .w { color: #bbbbbb } /* Text.Whitespace */ +.highlight .mb { color: #666666 } /* Literal.Number.Bin */ +.highlight .mf { color: #666666 } /* Literal.Number.Float */ +.highlight .mh { color: #666666 } /* Literal.Number.Hex */ +.highlight .mi { color: #666666 } /* Literal.Number.Integer */ +.highlight .mo { color: #666666 } /* Literal.Number.Oct */ +.highlight .sa { color: #BA2121 } /* Literal.String.Affix */ +.highlight .sb { color: #BA2121 } /* Literal.String.Backtick */ +.highlight .sc { color: #BA2121 } /* Literal.String.Char */ +.highlight .dl { color: #BA2121 } /* Literal.String.Delimiter */ +.highlight .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */ +.highlight .s2 { color: #BA2121 } /* Literal.String.Double */ +.highlight .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */ +.highlight .sh { color: #BA2121 } /* Literal.String.Heredoc */ +.highlight .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */ +.highlight .sx { color: #008000 } /* Literal.String.Other */ +.highlight .sr { color: #BB6688 } /* Literal.String.Regex */ +.highlight .s1 { color: #BA2121 } /* Literal.String.Single */ +.highlight .ss { color: #19177C } /* Literal.String.Symbol */ +.highlight .bp { color: #008000 } /* Name.Builtin.Pseudo */ +.highlight .fm { color: #0000FF } /* Name.Function.Magic */ +.highlight .vc { color: #19177C } /* Name.Variable.Class */ +.highlight .vg { color: #19177C } /* Name.Variable.Global */ +.highlight .vi { color: #19177C } /* Name.Variable.Instance */ +.highlight .vm { color: #19177C } /* Name.Variable.Magic */ +.highlight .il { color: #666666 } /* Literal.Number.Integer.Long */ diff --git a/static/css/site.css b/static/css/site.css new file mode 100644 index 0000000..ebc590a --- /dev/null +++ b/static/css/site.css @@ -0,0 +1,404 @@ +@import url("pygment.css"); + +@font-face { + font-family: 'Latin Modern'; + font-style: normal; + font-weight: normal; + font-display: swap; + src: url('../fonts/LM-regular.woff2') format('woff2'), + url('../fonts/LM-regular.woff') format('woff'), + url('../fonts/LM-regular.ttf') format('truetype'); +} + +@font-face { + font-family: 'Latin Modern'; + font-style: italic; + font-weight: normal; + font-display: swap; + src: url('../fonts/LM-italic.woff2') format('woff2'), + url('../fonts/LM-italic.woff') format('woff'), + url('../fonts/LM-italic.ttf') format('truetype'); +} + +@font-face { + font-family: 'Latin Modern'; + font-style: normal; + font-weight: bold; + font-display: swap; + src: url('../fonts/LM-bold.woff2') format('woff2'), + url('../fonts/LM-bold.woff') format('woff'), + url('../fonts/LM-bold.ttf') format('truetype'); +} + +@font-face { + font-family: 'Latin Modern'; + font-style: italic; + font-weight: bold; + font-display: swap; + src: url('../fonts/LM-bold-italic.woff2') format('woff2'), + url('../fonts/LM-bold-italic.woff') format('woff'), + url('../fonts/LM-bold-italic.ttf') format('truetype'); +} + +*, *::before, *::after { + box-sizing: border-box; +} +body, h1, h2, h3, h4, p, ul[class], ol[class], li, figure, figcaption, dl, dd { + margin: 0; +} + +html, body { + height: 98%; + max-width: 1280px; + margin: auto; +} + +html { + font-size: 1rem; + scroll-behavior: smooth; +} + +body { + display: flex; + flex-flow: column nowrap; + font-family: 'Latin Modern', Georgia, Cambria, 'Times New Roman', Times, serif; + line-height: 1.8; + min-height: 100vh; + overflow-x: hidden; + margin: 0 auto; + padding: 2rem 1.25rem; + color: hsl(0, 5%, 10%); + background-color: hsl(210, 20%, 98%); + text-rendering: optimizeLegibility; +} + +p { + text-align: justify; + hyphens: auto; + margin-top: 1rem; +} + +a:not([class]) { + text-decoration-skip-ink: auto; +} + +a, a:visited { + color: #a00; +} + +a:focus { + outline-offset: 2px; + outline: 2px solid hsl(220, 90%, 52%); +} + + +h1 { + font-size: 2.5rem; + line-height: 3.25rem; + margin-bottom: 1.625rem; +} +h2 { + font-size: 1.7rem; + line-height: 2rem; + margin-top: 3rem; +} +h3 { + font-size: 1.4rem; + margin-top: 2.5rem; +} +h4 { + font-size: 1.2rem; + margin-top: 2rem; +} +h5 { + font-size: 1rem; + margin-top: 1.8rem; +} +h6 { + font-size: 1rem; + font-style: italic; + font-weight: normal; + margin-top: 2.5rem; +} + +h3, h4, h5, h6 { + line-height: 1.625rem; +} + +h1 + h2 { + margin-top: 1.625rem; +} + +h2 + h3, h3 + h4, h4 + h5 { + margin-top: 0.8rem; +} + +h5 + h6 { + margin-top: -0.8rem; +} + +h2, h3, h4, h5, h6 { + margin-bottom: 0.8rem; +} + +ul, ol { + padding: 0; +} + +#banner, #contentinfo { + width: 100%; + text-align: center; +} + +#contentinfo { + flex-shrink: 0; + margin-top: 40px +} + + +#container { + flex: 1 0 auto; + display: flex; + align-items: stretch; + max-width: 100%; +} + +@media only screen and (max-width: 1024px) { + #container { + flex-flow: row wrap; + } +} + +#menu { + min-width: 300px; +} + +.menuitems { + list-style: none; +} + +#content { + flex: 1 1 auto; +} + +#post-list li { + list-style: none; +} + +.entry-title { + text-align: center; +} +div.post-info { + text-align: center; +} + +.author a { + margin: 0.85rem 0; + font-variant-caps: small-caps; + text-align: center; +} + +footer.post-info { + display: flex; + flex-flow: row wrap; + justify-content: space-between; + padding: 1rem; +} + +.entry-title { + text-align: center; +} + +/* + * Links + */ + +.entry-content a { + counter-increment: entrylinks; + text-decoration: none; + color: inherit; + outline: none; + cursor: default; + pointer-events: none; +} +.entry-content a:after { + content: '[' counter(entrylinks) ']'; + margin-left: 2px; + color: #a00; + cursor: pointer; + pointer-events: auto; +} + +/* + * Lists + */ + +.entry-content ol, +.entry-content ul { + padding-left: 40px; +} + +.entry-content li>ol, +.entry-content li>ul { + padding-left: 20px; +} + +/* + * Images + */ + +.entry-content img { + counter-increment: figures; + display: block; + max-width: 80%; + margin: 0 auto 0 auto; + padding: 1rem; +} + +.entry-content img~em{ + display: block; + margin: 0 auto 0 auto; + text-align: center; + font-style: normal; +} +.entry-content img~em:before { + content: 'Figure ' counter(figures) ': '; + font-weight: bold; +} + +/* + * Tables + */ + +.entry-content table:not([class="highlighttable"]) { + counter-increment: tables; + max-width: 80%; + margin: 0 auto 0 auto; + padding: 1rem; + border-collapse: collapse; + border-spacing: 0; +} + +.entry-content table~p > em{ + display: block; + margin: 0 auto 0 auto; + text-align: center; + font-style: normal; +} + +.entry-content table~p > em:before { + content: 'Table ' counter(tables) ': '; + font-weight: bold; +} + +.entry-content th, td { + padding: 0.5rem; +} + +.entry-content td { + border-bottom: 1px solid hsl(0, 0%, 85%); +} + +.entry-content th:not([align]), td:not([align]) { + text-align: left; +} + +.entry-content th:empty, +.entry-content td:empty { + border-left: 1px solid hsl(0, 0%, 85%); + width: 0; + padding: 0; +} + +.entry-content th:empty~th:empty, +.entry-content td:empty~td:empty { + border-left: 1px double hsl(0, 0%, 85%); +} + + +.entry-content thead th { + border-bottom: 2px solid hsl(0, 0%, 70%); +} + +.entry-content tfoot th { + border-top: 2px solid hsl(0, 0%, 70%); +} + +/* + * Code + */ + +.entry-content table.highlighttable, +.entry-content div.highlight { + width: 100%; + max-width: 100%; +} + +.entry-content div.highlight { + counter-increment: listings; +} + +.entry-content table.highlighttable~p > em, +.entry-content div.highlight~p > em { + display: block; + margin: 0 auto 0 auto; + text-align: center; + font-style: normal; +} +.entry-content table.highlighttable~p > em:before, +.entry-content div.highlight~p > em:before { + content: 'Listing ' counter(listings) ': '; + font-weight: bold; +} + +.entry-content td.linenos, +.entry-content td.code { + border-bottom: none; +} + +.entry-content code, pre { + font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace; + font-size: 85%; +} + +.entry-content pre { + max-width: 100%; + overflow: auto; + border-radius: 4px; +} +.entry-content pre code { + font-size: 95%; + position: relative; +} + +.linenos { + width: 3em; +} + +/* This is old stuff, inherited from LaTeX.css, probably unused */ + +/* Nested ordered list for ToC */ +.toc ol { + counter-reset: item; + padding-left: 2rem; +} +.toc li { + display: block; +} +.toc li:before { + content: counters(item, '.') ' '; + counter-increment: item; + padding-right: 0.85rem; +} + +/* Make footnote text smaller and left align it (looks bad with long URLs) */ +.footnotes p { + text-align: left; + line-height: 1.5; + font-size: 85%; + margin-bottom: 0.4rem; +} +.footnotes { + border-top: 1px solid hsl(0, 0%, 39%); +} + diff --git a/static/fonts/LM-bold-italic.ttf b/static/fonts/LM-bold-italic.ttf new file mode 100644 index 0000000..7b684ee Binary files /dev/null and b/static/fonts/LM-bold-italic.ttf differ diff --git a/static/fonts/LM-bold-italic.woff b/static/fonts/LM-bold-italic.woff new file mode 100644 index 0000000..d54af37 Binary files /dev/null and b/static/fonts/LM-bold-italic.woff differ diff --git a/static/fonts/LM-bold-italic.woff2 b/static/fonts/LM-bold-italic.woff2 new file mode 100644 index 0000000..078ce29 Binary files /dev/null and b/static/fonts/LM-bold-italic.woff2 differ diff --git a/static/fonts/LM-bold.ttf b/static/fonts/LM-bold.ttf new file mode 100644 index 0000000..17624d4 Binary files /dev/null and b/static/fonts/LM-bold.ttf differ diff --git a/static/fonts/LM-bold.woff b/static/fonts/LM-bold.woff new file mode 100644 index 0000000..318a3ad Binary files /dev/null and b/static/fonts/LM-bold.woff differ diff --git a/static/fonts/LM-bold.woff2 b/static/fonts/LM-bold.woff2 new file mode 100644 index 0000000..c14c620 Binary files /dev/null and b/static/fonts/LM-bold.woff2 differ diff --git a/static/fonts/LM-italic.ttf b/static/fonts/LM-italic.ttf new file mode 100644 index 0000000..b9a57b8 Binary files /dev/null and b/static/fonts/LM-italic.ttf differ diff --git a/static/fonts/LM-italic.woff b/static/fonts/LM-italic.woff new file mode 100644 index 0000000..fafb147 Binary files /dev/null and b/static/fonts/LM-italic.woff differ diff --git a/static/fonts/LM-italic.woff2 b/static/fonts/LM-italic.woff2 new file mode 100644 index 0000000..166d6e6 Binary files /dev/null and b/static/fonts/LM-italic.woff2 differ diff --git a/static/fonts/LM-regular.ttf b/static/fonts/LM-regular.ttf new file mode 100644 index 0000000..6b4f6b8 Binary files /dev/null and b/static/fonts/LM-regular.ttf differ diff --git a/static/fonts/LM-regular.woff b/static/fonts/LM-regular.woff new file mode 100644 index 0000000..eb9fec0 Binary files /dev/null and b/static/fonts/LM-regular.woff differ diff --git a/static/fonts/LM-regular.woff2 b/static/fonts/LM-regular.woff2 new file mode 100644 index 0000000..869279a Binary files /dev/null and b/static/fonts/LM-regular.woff2 differ diff --git a/templates/archives.html b/templates/archives.html new file mode 100644 index 0000000..cd12950 --- /dev/null +++ b/templates/archives.html @@ -0,0 +1,14 @@ +{% extends "base.html" %} + +{% block title %}{{ SITENAME }} - Archives{% endblock %} + +{% block content %} +

Archives for {{ SITENAME }}

+ +
+{% for article in dates %} +
{{ article.locale_date }}
+
{{ article.title }}
+{% endfor %} +
+{% endblock %} diff --git a/templates/article.html b/templates/article.html new file mode 100644 index 0000000..ca86048 --- /dev/null +++ b/templates/article.html @@ -0,0 +1,69 @@ +{% 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 %} + + {% endif %} + + {% for tag in article.tags %} + + {% endfor %} + +{% endblock %} + +{% block content %} +
+
+

+ {{ article.title }}

+ {% import 'translations.html' as translations with context %} + {{ translations.translations_for(article) }} + +
+
+ {{ article.content }} +
+
+ {% if article.category %} +
+ Category: {{ article.category }} +
+ {% endif %} + {% if article.tags %} +
+ Tags: + {% for tag in article.tags %} + {{ tag }} + {% endfor %} +
+ {% endif %} +
+
+{% endblock %} + + diff --git a/templates/author.html b/templates/author.html new file mode 100644 index 0000000..a190194 --- /dev/null +++ b/templates/author.html @@ -0,0 +1,8 @@ +{% extends "index.html" %} + +{% block title %}{{ SITENAME }} - Articles by {{ author }}{% endblock %} + +{% block content_title %} +

Articles by {{ author }}

+{% endblock %} + diff --git a/templates/authors.html b/templates/authors.html new file mode 100644 index 0000000..9aee5db --- /dev/null +++ b/templates/authors.html @@ -0,0 +1,12 @@ +{% extends "base.html" %} + +{% block title %}{{ SITENAME }} - Authors{% endblock %} + +{% block content %} +

Authors on {{ SITENAME }}

+ +{% endblock %} diff --git a/templates/base.html b/templates/base.html new file mode 100644 index 0000000..7f04f60 --- /dev/null +++ b/templates/base.html @@ -0,0 +1,82 @@ + + + + + + + {% block head %} + {% block title %}{{ SITENAME }}{% endblock title %} + + + {% if FEED_ALL_ATOM %} + + {% endif %} + {% if FEED_ALL_RSS %} + + {% endif %} + {% if FEED_ATOM %} + + {% endif %} + {% if FEED_RSS %} + + {% endif %} + {% if CATEGORY_FEED_ATOM and category %} + + {% endif %} + {% if CATEGORY_FEED_RSS and category %} + + {% endif %} + {% if TAG_FEED_ATOM and tag %} + + {% endif %} + {% if TAG_FEED_RSS and tag %} + + {% endif %} + {% endblock head %} + + + + + + + + +
+ + {% block content %} + {% endblock %} +
+ + + + + + + + diff --git a/templates/categories.html b/templates/categories.html new file mode 100644 index 0000000..7999de4 --- /dev/null +++ b/templates/categories.html @@ -0,0 +1,12 @@ +{% extends "base.html" %} + +{% block title %}{{ SITENAME }} - Categories{% endblock %} + +{% block content %} +

Categories on {{ SITENAME }}

+ +{% endblock %} diff --git a/templates/category.html b/templates/category.html new file mode 100644 index 0000000..14d7ff0 --- /dev/null +++ b/templates/category.html @@ -0,0 +1,8 @@ +{% extends "index.html" %} + +{% block title %}{{ SITENAME }} - {{ category }} category{% endblock %} + +{% block content_title %} +

Articles in the {{ category }} category

+{% endblock %} + diff --git a/templates/gosquared.html b/templates/gosquared.html new file mode 100644 index 0000000..49ccbbe --- /dev/null +++ b/templates/gosquared.html @@ -0,0 +1,14 @@ +{% if GOSQUARED_SITENAME %} + +{% endif %} diff --git a/templates/index.html b/templates/index.html new file mode 100644 index 0000000..f764673 --- /dev/null +++ b/templates/index.html @@ -0,0 +1,44 @@ +{% extends "base.html" %} + +{% block content %} + +
+ {% block content_title %} +

All articles

+ {% endblock %} + +
    + {% for article in articles_page.object_list %} +
  1. +
    +
    +

    + {{ article.title }} +

    + +
    + +
    + {{ article.summary }} +
    +
    +
  2. + {% endfor %} +
+ + {% if articles_page.has_other_pages() %} + {% include 'pagination.html' %} + {% endif %} + +
+ +{% endblock content %} + + diff --git a/templates/page.html b/templates/page.html new file mode 100644 index 0000000..7150d42 --- /dev/null +++ b/templates/page.html @@ -0,0 +1,27 @@ +{% extends "base.html" %} +{% block html_lang %}{{ page.lang }}{% endblock %} + +{% block title %}{{ SITENAME }} - {{ page.title }}{%endblock%} + +{% block head %} + {{ super() }} + + {% import 'translations.html' as translations with context %} + {% if translations.entry_hreflang(page) %} + {{ translations.entry_hreflang(page) }} + {% endif %} +{% endblock %} + +{% block content %} +

{{ page.title }}

+ {% import 'translations.html' as translations with context %} + {{ translations.translations_for(page) }} + + {{ page.content }} + + {% if page.modified %} +

+ Last updated: {{ page.locale_modified }} +

+ {% endif %} +{% endblock %} diff --git a/templates/pagination.html b/templates/pagination.html new file mode 100644 index 0000000..4219a5c --- /dev/null +++ b/templates/pagination.html @@ -0,0 +1,11 @@ +{% if DEFAULT_PAGINATION %} +

+ {% if articles_page.has_previous() %} + « + {% endif %} + Page {{ articles_page.number }} / {{ articles_paginator.num_pages }} + {% if articles_page.has_next() %} + » + {% endif %} +

+{% endif %} diff --git a/templates/period_archives.html b/templates/period_archives.html new file mode 100644 index 0000000..e1ddf62 --- /dev/null +++ b/templates/period_archives.html @@ -0,0 +1,14 @@ +{% extends "base.html" %} + +{% block title %}{{ SITENAME }} - {{ period | reverse | join(' ') }} archives{% endblock %} + +{% block content %} +

Archives for {{ period | reverse | join(' ') }}

+ +
+{% for article in dates %} +
{{ article.locale_date }}
+
{{ article.title }}
+{% endfor %} +
+{% endblock %} diff --git a/templates/tag.html b/templates/tag.html new file mode 100644 index 0000000..9c95803 --- /dev/null +++ b/templates/tag.html @@ -0,0 +1,7 @@ +{% extends "index.html" %} + +{% block title %}{{ SITENAME }} - {{ tag }} tag{% endblock %} + +{% block content_title %} +

Articles tagged with {{ tag }}

+{% endblock %} diff --git a/templates/tags.html b/templates/tags.html new file mode 100644 index 0000000..b90b0ac --- /dev/null +++ b/templates/tags.html @@ -0,0 +1,12 @@ +{% extends "base.html" %} + +{% block title %}{{ SITENAME }} - Tags{% endblock %} + +{% block content %} +

Tags for {{ SITENAME }}

+ +{% endblock %} diff --git a/templates/translations.html b/templates/translations.html new file mode 100644 index 0000000..f0e2478 --- /dev/null +++ b/templates/translations.html @@ -0,0 +1,16 @@ +{% macro translations_for(article) %} +{% if article.translations %} +Translations: +{% for translation in article.translations %} +{{ translation.lang }} +{% endfor %} +{% endif %} +{% endmacro %} + +{% macro entry_hreflang(entry) %} +{% if entry.translations %} + {% for translation in entry.translations %} + + {% endfor %} +{% endif %} +{% endmacro %}