initial commit

This commit is contained in:
error 2023-10-24 13:53:49 +02:00
commit c3d393742d
13 changed files with 850 additions and 0 deletions

9
LICENSE Normal file
View File

@ -0,0 +1,9 @@
MIT License
Copyright (c) 2023 error
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

23
README.md Normal file
View File

@ -0,0 +1,23 @@
# Undefined Theme
This repository contains the pelican template for [undefinedbehavior.de](undefinedbehavior.de).
## Installation
Clone this repository and install it using `pelican-themes -i path_to_this_theme`.
If you prefer to install it by adding a symbolic link instead of copying the theme, use `pelican-themes -s path_to_this_theme`.
## Usage
Set `THEME = 'undefined-theme'` in your `pelicanconf.py` to use this theme for your website.
## Credits
This theme uses the fonts [Maven Pro](https://fonts.google.com/specimen/Maven+Pro) (SIL OFL) and [Oxygen Mono](https://fonts.google.com/specimen/Oxygen+Mono) (SIL OFL).
To remove browser-side default CSS settings, this theme uses [reset.css](http://meyerweb.com/eric/tools/css/reset/) (public domain).
The sidenote are heavily inspires by [latex.css](https://latex.now.sh) (MIT License).
Thank you

49
static/css/reset.css Normal file
View File

@ -0,0 +1,49 @@
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}

313
static/css/undef.css Normal file
View File

@ -0,0 +1,313 @@
@font-face {
font-family: 'Maven Pro';
font-display: swap;
src: local('Maven Pro'),
url('../fonts/MavenPro/MavenPro-VariableFont_wght.ttf') format('truetype');
}
@font-face {
font-family: 'Oxygen Mono';
font-display: swap;
src: local('Oxygen Mono'),
url('../fonts/OxygenMono/OxygenMono-Regular.ttf') format('truetype');
}
:root {
--accent-a: #008080;
--accent-b: #800000;
--text: #000000;
--gradient: linear-gradient(45deg, #800000 10%, #008080 90%);
--background: #ffffff;
--pre-bg: #e8edf2;
}
@media (prefers-color-scheme: dark) {
:root {
--accent-a: #7acccc;
--accent-b: #ff0080;
--text: #ffffff;
--gradient: linear-gradient(45deg, #ff0080 10%, #7acccc 90%);
--background: #222222;
--pre-bg: #403f3f;
}
}
body {
min-height: 100vh;
background-color: var(--background);
font-family: 'Maven Pro';
box-sizing: border-box;
padding: 2ch;
display: grid;
grid-template-columns: 1fr 8rem 50rem 16rem 1fr;
grid-template-rows: 1fr auto 1fr;
justify-content: center;
align-items: start;
counter-reset: sidenote-counter;
}
a,
a:visited,
main > label {
color: var(--accent-a);
text-decoration: none;
}
main a:hover:not(nav a),
footer > a,
main > label:hover {
color: var(--accent-b);
}
body > header {
grid-row: 2;
grid-column: 2;
writing-mode: sideways-rl;
border-image: var(--gradient) 1;
border-right-color: var(--accent-a);
border-right-style: solid;
border-right-width: 5px;
padding-bottom: 1rem;
}
body > header > a > h1 {
background: var(--gradient);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
color: var(--accent-b);
font-size: 4rem;
text-align: left;
height: fit-content;
}
body > main {
grid-row: 2;
grid-column: 3;
padding-left: 1rem;
line-height: 1.2;
max-width: 50rem;
align-self: center;
color: var(--text);
font-size: 1.2rem;
}
nav a:hover
{
text-decoration: underline;
}
nav > footer {
padding-top: 1ch;
font-size: 1rem;
color: var(--accent-b);
}
input[type="checkbox"] {
display: none;
}
#shownav + label {
display: block;
width: 100%;
text-align: right;
}
#shownav + label + nav {
display: none;
text-align: center;
}
#shownav:checked + label + nav {
display: block;
}
nav > ul {
font-size: 2.4rem;
color: var(--accent-a);
}
label[for="shownav"]::before {
content: ""
}
#shownav:checked + label[for="shownav"]::before {
content: "∧"
}
#title,
#meta,
#abstract {
text-align: center;
padding-top: 1rem;
padding-bottom: 1rem;
}
#abstract {
font-size: 1rem;
font-style: italic;
}
.metainfo {
font-size: 1rem;
text-align: right;
}
main h1 {
font-size: 3.2rem;
padding-top: 1rem;
padding-bottom: 1rem;
}
main h2 {
font-size: 2.8rem;
padding-top: 1rem;
padding-bottom: 1rem;
}
main h3 {
font-size: 2.6rem;
padding-top: 1rem;
padding-bottom: 1rem;
}
main h4 {
font-size: 2.4rem;
padding-top: 1rem;
padding-bottom: 1rem;
}
main h5 {
font-size: 2.2rem;
padding-top: 1rem;
padding-bottom: 1rem;
}
article > p {
padding-top: 1rem;
padding-bottom: 1rem;
text-align: justify;
}
main article p {
text-indent: 2rem;
}
main dl dt {
font-weight: bold;
}
main dl dd {
text-align: justify;
padding-left: 2rem;
padding-bottom: 0.5rem;
}
main em {
font-style: italic;
}
code {
font-family: 'Oxygen Mono';
}
pre {
padding: 1rem;
background-color: var(--pre-bg);
max-width: 100%;
overflow: auto;
border-radius: 1rem;
}
main img {
margin-left: -2rem; /*remove text indent for img*/
width: 100%;
}
video {
width: 100%;
}
.sidenote {
font-size: 0.8rem;
float: right;
clear: right;
width: 15rem;
margin-right: -16rem;
margin-bottom: 1em;
}
.sidenote-number {
counter-increment: sidenote-counter;
}
label.sidenote-toggle:not(.sidenote-number) {
display: none;
}
label.sidenote-toggle {
display: inline;
cursor: pointer;
}
.sidenote-number::after {
content: counter(sidenote-counter);
font-size: 0.7rem;
vertical-align: super;
}
.sidenote-number ~ .sidenote::before {
content: counter(sidenote-counter) ' ';
font-size: 0.7rem;
vertical-align: super;
}
.footnote-ref::before {
content: '[';
}
.footnote-ref::after {
content: ']';
}
.footnote ol {
counter-reset: fn-counter;
padding-left: 2rem;
}
.footnote li {
counter-increment: fn-counter;
padding-bottom: 0.5rem;
}
.footnote li::marker {
content: '[' counter(fn-counter) '] ';
}
.footnote p {
text-indent: 0rem;
}
@media (max-width: 74rem) {
body {
grid-template-columns: 1fr 8rem calc(100vw - 9rem) 1fr;
}
label.sidenote-toggle:not(.sidenote-number) {
display: inline;
}
.sidenote {
display: none;
}
.sidenote-toggle:checked + .sidenote {
display: block;
margin-top: 0.5rem;
margin-bottom: 0.5rem;
margin-left: 5%;
margin-right: 5%;
float: none;
clear: both;
width: 90%;
}
}

Binary file not shown.

View File

@ -0,0 +1,93 @@
Copyright 2011 The Maven Pro Project Authors (http://www.vissol.co.uk/mavenpro/), with Reserved Font Name "Maven Pro".
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.

View File

@ -0,0 +1,93 @@
Copyright (c) 2012, vernon adams (vern@newtypography.co.uk), with Reserved Font Names 'Oxygen'
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.

Binary file not shown.

58
templates/archives.html Normal file
View File

@ -0,0 +1,58 @@
{% extends "base.html" %}
{% block head_title %}
{{ SITENAME | striptags }} :: Blog
{% endblock head_title %}
{% block head %}
{{ super() }}
{% if DESCRIPTION %}
<meta name="description" content="{{ DESCRIPTION }}" />
{% endif %}
{% endblock head %}
{% block main %}
<section id="title">
<h1>
Blog
</h1>
</section>
{% if DESCRIPTION %}
<section id="abstract">
<p>
{{ DESCRIPTION }}
</p>
</section>
{% endif %}
<dl>
{% for article in dates %}
<dt>
<a href="{{ SITEURL }}/{{ article.url }}">
{{ article.title }}
</a>
</dt>
<dd>
{{ article.summary }}
<p class="metainfo">
{% if article.authors %}
{% for author in article.authors %}
{{ author }}
{% if not loop.last %}
,
{% else %}
::
{% endif %}
{% endfor %}
{% endif %}
{{ article.locale_date }}
{% if article.license %}
::
<a href="{{ article.license[1] }}">
{{ article.license[0] }}
</a>
{% endif %}
</p>
</dd>
{% endfor %}
</dl>
{% endblock main %}

56
templates/article.html Normal file
View File

@ -0,0 +1,56 @@
{% extends "base.html" %}
{% block head_title %}
{{ SITENAME | striptags }} :: {{ article.title|striptags }}
{% endblock head_title %}
{% block head %}
{{ super() }}
{% if article.summary %}
<meta name="description" content="{{article.summary}}" />
{% endif %}
{% for tag in article.tags %}
<meta name="tags" content="{{tag}}" />
{% endfor %}
{% endblock %}
{% block main %}
<section id="title">
<h1>
{{ article.title }}
</h1>
<p id="meta">
{% if article.authors %}
{% for author in article.authors %}
{{ author }}
{% if not loop.last %}
,
{% else %}
<br />
{% endif %}
{% endfor %}
{% endif %}
{{ article.locale_date }}
{% if article.license %}
<br />
<a href="{{ article.license[1] }}">
{{ article.license[0] }}
</a>
{% endif %}
</p>
</section>
{% if article.summary %}
<section id="abstract">
<p>
{{ article.summary }}
</p>
</section>
<article>
{% if 'add_sidenotes' in JINJA_FILTERS %}
{{ article.content | add_sidenotes }}
{% else %}
{{ article.content }}
{% endif %}
</article>
{% endif %}
{% endblock main %}

94
templates/base.html Normal file
View File

@ -0,0 +1,94 @@
<!DOCTYPE html>
<html lang="{% block html_lang %}{{ DEFAULT_LANG }}{% endblock html_lang %}">
<head>
{% block head %}
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="generator" content="Pelican" />
<title>
{% block head_title %}
{{ SITENAME | striptags }}
{% endblock head_title %}
</title>
<link rel="stylesheet" href="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/css/reset.css" />
<link rel="stylesheet" href="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/css/undef.css" />
{% if FAVICON %}
<link rel="icon" type="image/svg+xml" href="{{ SITEURL }}/{{ FAVICON }}" sizes="any" />
{% endif %}
{% if FEED_ALL_ATOM %}
<link rel="alternate" href="{{ FEED_DOMAIN }}/{% if FEED_ALL_ATOM_URL %}{{ FEED_ALL_ATOM_URL }}{% else %}{{ FEED_ALL_ATOM }}{% endif %}" type="application/atom+xml" title="{{ SITENAME }} Atom Feed" />
{% endif %}
{% if FEED_ALL_RSS %}
<link rel="alternate" href="{{ FEED_DOMAIN }}/{% if FEED_ALL_RSS_URL %}{{ FEED_ALL_RSS_URL }}{% else %}{{ FEED_ALL_RSS }}{% endif %}" type="application/rss+xml" title="{{ SITENAME }} RSS Feed" />
{% endif %}
{% endblock head %}
</head>
<body>
<header>
<a href="/">
<h1>
{{ SITENAME }}
</h1>
</a>
</header>
<main>
{% block shownav %}
<input type="checkbox" id="shownav">
<label for="shownav">menu</label>
{% endblock shownav %}
<nav>
<ul>
{% if DISPLAY_PAGES_ON_MENU %}
{% for p in pages %}
<li>
<a href="{{ SITEURL }}/{{ p.url }}">
{{ p.title }}
</a>
</li>
{% endfor %}
{% endif %}
{% if DISPLAY_CATEGORIES_ON_MENU %}
{% for c in categories %}
<li>
<a href="{{ SITEURL }}/{{ c.url }}">
{{ c.name }}
</a>
</li>
{% endfor %}
{% endif %}
<li>
<a href="{{ SITEURL }}/{{ ARCHIVES_SAVE_AS }}">
Blog
</a>
</li>
{% if FEED_ALL_ATOM %}
<li>
<a href="{{ FEED_DOMAIN }}/{% if FEED_ALL_ATOM_URL %}{{ FEED_ALL_ATOM_URL }}{% else %}{{ FEED_ALL_ATOM }}{% endif %}">
Atom Feed
</a>
</li>
{% endif %}
{% if FEED_ALL_RSS %}
<li>
<a href="{{ FEED_DOMAIN }}/{% if FEED_ALL_RSS_URL %}{{ FEED_ALL_RSS_URL }}{% else %}{{ FEED_ALL_RSS }}{% endif %}">
RSS Feed
</a>
</li>
{% endif %}
</ul>
<footer>
{% for title, link in LINKS %}
<a href="{{ link }}">
{{ title | lower }}
</a>
{% if not loop.last %}
::
{% endif %}
{% endfor %}
</footer>
</nav>
{% block main %}
{% endblock main %}
</main>
</body>
</html>

4
templates/index.html Normal file
View File

@ -0,0 +1,4 @@
{% extends "base.html" %}
{% block shownav %}
{% endblock shownav %}

58
templates/page.html Normal file
View File

@ -0,0 +1,58 @@
{% extends "base.html" %}
{% block head_title %}
{{ SITENAME | striptags }} :: {{ page.title|striptags }}
{% endblock head_title %}
{% block head %}
{{ super() }}
{% if page.summary %}
<meta name="description" content="{{page.summary}}" />
{% endif %}
{% for tag in page.tags %}
<meta name="tags" content="{{tag}}" />
{% endfor %}
{% endblock %}
{% block main %}
<section id="title">
<h1>
{{ page.title }}
</h1>
{% if not page.hidemeta %}
<p id="meta">
{% if page.authors %}
{% for author in page.authors %}
{{ author }}
{% if not loop.last %}
,
{% else %}
<br />
{% endif %}
{% endfor %}
{% endif %}
{{ page.locale_date }}
{% if page.license %}
<br />
<a href="{{ page.license[1] }}">
{{ page.license[0] }}
</a>
{% endif %}
</p>
{% endif %}
</section>
{% if page.summary %}
<section id="abstract">
<p>
{{ page.summary }}
</p>
</section>
<article>
{% if 'add_sidenotes' in JINJA_FILTERS %}
{{ page.content | add_sidenotes }}
{% else %}
{{ page.content }}
{% endif %}
</article>
{% endif %}
{% endblock main %}