diff options
author | Johannes Löthberg <johannes@kyriasis.com> | 2014-10-18 14:14:30 +0200 |
---|---|---|
committer | Johannes Löthberg <johannes@kyriasis.com> | 2014-10-18 14:14:30 +0200 |
commit | b944832d593683e54c216d23bb493b302b521e29 (patch) | |
tree | 6c4376d642e8245a6a41e44d4a8e090a481185bb | |
parent | 80e38791f41cf326e43946e306157daa7d7e08e1 (diff) | |
download | theos-website-b944832d593683e54c216d23bb493b302b521e29.tar.xz |
convert root page to reST like ~kyrias/
-rw-r--r-- | Makefile | 22 | ||||
-rw-r--r-- | mail/config-v1.1.xml | 23 | ||||
-rw-r--r-- | partials/footer.html | 6 | ||||
-rw-r--r-- | partials/meta.html | 10 | ||||
-rw-r--r-- | partials/nav.html | 7 | ||||
-rwxr-xr-x | scripts/bupa | 74 | ||||
-rw-r--r-- | src/.well-known/keybase.txt (renamed from .well-known/keybase.txt) | 0 | ||||
-rw-r--r-- | src/index.html | 46 | ||||
-rw-r--r-- | src/index.rst | 40 | ||||
-rw-r--r-- | src/sitemap1.xml | 3 | ||||
-rw-r--r-- | src/style.css | 17 | ||||
-rw-r--r-- | src/templates/layout.html | 33 | ||||
-rw-r--r-- | src/templates/page.html | 12 |
13 files changed, 182 insertions, 111 deletions
@@ -1,27 +1,25 @@ HTML := index.html CSS := style.css - -PARTIALS := $(addprefix partials/, meta.html nav.html footer.html) WELLKNOWN := $(addprefix .well-known/, keybase.txt) -FILES := $(HTML) $(CSS) robots.txt sitemap.xml sitemap1.xml +FILES := $(HTML) $(CSS) robots.txt sitemap.xml sitemap1.xml \ + $(WELLKNOWN) + +site: build/.well-known/ $(addprefix build/, $(FILES)) -site: $(addprefix build/, $(FILES) $(WELLKNOWN)) +build/%/: + mkdir -P $@ clean: -rm $(addprefix build/, $(FILES)) -build/%.html: src/%.html $(PARTIALS) - @./scripts/awink $< $@ - @echo Compiled $< → $@ - -build/%.css: src/%.css - @install -Dm644 $< $@ - @echo Compiled $< → $@ +build/%.html: src/%.rst + @./scripts/bupa $@ + @echo Built $@ from $< build/%: src/% @install -Dm644 $< $@ - @echo Compiled $< → $@ + @echo Copied $< → $@ build/.well-known/%: .well-known/% @install -Dm644 $< $@ diff --git a/mail/config-v1.1.xml b/mail/config-v1.1.xml deleted file mode 100644 index d6454b1..0000000 --- a/mail/config-v1.1.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<clientConfig version="1.1"> - <emailProvider id="kyriasis.com"> - <domain>kyriasis.com</domain> - <displayName>Kyriasis Mail</displayName> - <displayShortName>Kyriasis</displayShortName> - <incomingServer type="imap"> - <hostname>theos.kyriasis.com</hostname> - <port>143</port> - <socketType>STARTTLS</socketType> - <authentication>password-cleartext</authentication> - <username>%EMAILLOCALPART%</username> - </incomingServer> - <outgoingServer type="smtp"> - <hostname>theos.kyriasis.com</hostname> - <port>587</port> - <socketType>STARTTLS</socketType> - <authentication>password-cleartext</authentication> - <username>%EMAILLOCALPART%</username> - </outgoingServer> - </emailProvider> -</clientConfig> diff --git a/partials/footer.html b/partials/footer.html deleted file mode 100644 index 014a62d..0000000 --- a/partials/footer.html +++ /dev/null @@ -1,6 +0,0 @@ -<footer> - <p id="copy"> - © <span itemprop="copyrightYear">2014</span> - by <a itemprop="copyrightHolder" rel="author" href="https://theos.kyriasis.com/~kyrias/about.html">Johannes Löthberg</a> - </p> -</footer> diff --git a/partials/meta.html b/partials/meta.html deleted file mode 100644 index 8e384f7..0000000 --- a/partials/meta.html +++ /dev/null @@ -1,10 +0,0 @@ -<link href="style.css" rel="stylesheet"> - -<meta name="viewport" content="width=device-width, initial-scale=1.0"> - -<meta name="description" content="Theos is the server running the primary services for the kyriasis domain"> - -<meta name="author" content="Johannes Löthberg"> - -<link rel="author" href="https://theos.kyriasis.com/~kyrias/about.html" - title="Johannes Löthberg <johannes@kyriasis.com>"> diff --git a/partials/nav.html b/partials/nav.html deleted file mode 100644 index cd4b785..0000000 --- a/partials/nav.html +++ /dev/null @@ -1,7 +0,0 @@ -<nav> - <ul> - <li><a href="index.html">theos/</a></li> - <li><a href="http://git.kyriasis.com">cgit/</a></li> - <li><a href="https://theos.kyriasis.com:6697">znc/</a></li> - </ul> -</nav> diff --git a/scripts/bupa b/scripts/bupa new file mode 100755 index 0000000..1fd06ff --- /dev/null +++ b/scripts/bupa @@ -0,0 +1,74 @@ +#!/usr/bin/env python +"""Usage: bupa <filename> + +Options: + -h --help Show this screen. +""" +from jinja2 import Environment, FileSystemLoader +import glob, yaml, docopt + +from docutils import core +from docutils.writers.html4css1 import Writer + +def reST_to_html(s): + return core.publish_parts(s, writer_name='html4css1')['html_body'] + +def filename_to_id(file_name): + return int(file_name.split('/')[-1]. + split('-')[0]. + split('.')[0]) + +class Page(object): + def __init__(self, page_dict): + self.id = None + self.title = page_dict['title'] + self.header = page_dict['header'] + self.date = page_dict['date'] + self.author = page_dict['author'] + if 'author_link' in page_dict: + self.author_link = page_dict['author_link'] + self.body = page_dict['body'][0] + +def parse(filename): + with open(filename, 'r') as file: + data = file.read() + + frontmatter, *body = data.split('\n\n', 1) + frontmatter = frontmatter.partition('\n')[2] + frontmatter = yaml.load(frontmatter) + + page_dict = frontmatter.copy() + page_dict['body'] = body + if not 'header' in page_dict: + page_dict['header'] = page_dict['title'] + + page = Page(page_dict) + return page + + with open('build/journal.html', 'w') as file: + file.write(template.render(entries=entries, title='~/journal', header='The lost journal')) + +def build_page(env, templ_name, pagename): + template = env.get_template(templ_name) + + page = parse('src/'+pagename+'.rst') + page.body = reST_to_html(page.body) + page.article_id = pagename + + with open('build/'+pagename+'.html', 'w') as file: + file.write(template.render(page=page, title=page.title, header=page.header)) + +def main(): + arguments = docopt.docopt(__doc__) + env = Environment(loader=FileSystemLoader('src/templates')) + + if '<filename>' in arguments: + file = arguments['<filename>'].split('/')[-1] + else: + exit(2) + + if file == 'index.html': + build_page(env, 'page.html', 'index') + +if __name__ == '__main__': + main() diff --git a/.well-known/keybase.txt b/src/.well-known/keybase.txt index 2d23d7c..2d23d7c 100644 --- a/.well-known/keybase.txt +++ b/src/.well-known/keybase.txt diff --git a/src/index.html b/src/index.html deleted file mode 100644 index cdc113a..0000000 --- a/src/index.html +++ /dev/null @@ -1,46 +0,0 @@ -<!DOCTYPE html> -<html lang="en"> -<head> - <meta charset="UTF-8"> - <title>theos/ | theos.kyriasis.com</title> -%include partials/meta.html -</head> -<body itemscope itemtype="http://schema.org/WebPage"> - <header> -%include partials/nav.html - <h1>theos/</h1> - </header> - - <article id="content"> - <h3>Welcome to theos.kyriasis.com</h3> - - <p>Theos is a server under the kyriasis domain owned and operated by <a href="https://theos.kyriasis.com/~kyrias/about.html">kyrias</a>, who also owns kyriasis.com itself. (Albeit not the server that the A/AAAA records on kyriasis.com points to for historical reasons.) - </p> - - <h3>Services running on theos:</h3> - <ul> - <li>HTTP services using the <a href="http://nginx.org/">NGINX</a> HTTP server</li> - <li>An LDAP tree running on <a href="http://www.openldap.org/">OpenLDAP</a></li> - <li>Email services using <a href="https://www.opensmtpd.org/">OpenSMTPD</a> and <a href="http://www.dovecot.org/">Dovecot</a></li> - <li>A Kerberos realm using the <a href="http://web.mit.edu/kerberos/">MIT Kerberos</a> implementation and the OpenLDAP backend</li> - <li>Git hosting using a combination of <a href="http://git.zx2c4.com/cgit/about/">cgit</a> and a slighly modified version of <a href="http://gitolite.com">gitolite</a> and OpenSSH for Kerberos authentication</li> - </ul> - - <p>All users with shell access have the option of getting an email under the kyriasis.com domain, web hosting under the theos.kyriasis.com domain or possibly under a custom subdomain, and public git hosting. (All git-push access requites using Kerberos for ssh authentication.) - </p> - </article> - - <article id="users"> - <h3>User pages</h3> - <ul> - <li><a href="/~kyrias">kyrias</a></li> - <li><a href="/~arch-tk">Arch-TK</a></li> - </ul> - </article> - - <p class="info-right">Last updated <time itemprop="dateModified" datetime="2014-10-12">2014-10-12</time></p> - <p class="info-right botborder"><a rel="author" href="https://theos.kyriasis.com/~kyrias/about.html">Johannes Löthberg</a></p> - -%include partials/footer.html -</body> -</html> diff --git a/src/index.rst b/src/index.rst new file mode 100644 index 0000000..5de7122 --- /dev/null +++ b/src/index.rst @@ -0,0 +1,40 @@ +.. frontmatter + title: theos/ + date: 2014-10-18 + author: Johannes Löthberg + author_link: ~kyrias/about.html + +Welcome to theos.kyriasis.com +----------------------------- + +Theos is a server under the kyriasis domain owned and operated by kyrias_, who also owns kyriasis.com itself. (Albeit not the server that the A/AAAA records on kyriasis.com points to for historical reasons.) + +Services running on theos: +------------------------------ + +* HTTP services using the NGINX_ HTTP server +* An LDAP tree running on OpenLDAP_ +* Email services using OpenSMTPD_ and Dovecot_ +* A Kerberos realm using the `MIT Kerberos`_ implementation and the OpenLDAP backend +* Git hosting using a combination of cgit_ and a slighly modified version of gitolite_ and OpenSSH for Kerberos authentication + +All users with shell access have the option of getting an email under the kyriasis.com domain, web hosting under the theos.kyriasis.com domain or possibly under a custom subdomain, and public git hosting. (All git-push access requites using Kerberos for ssh authentication.) + +User pages +---------- + +.. role:: raw-html(raw) + :format: html + +* kyrias_ +* Arch-TK_ + +.. _kyrias: https://theos.kyriasis.com/~kyrias/ +.. _Arch-TK: https://theos.kyriasis.com/~arch-tk/ +.. _NGINX: http://nginx.org/ +.. _OpenLDAP: http://www.openldap.org/ +.. _OpenSMTPD: https://www.opensmtpd.org/ +.. _Dovecot: http://www.dovecot.org/ +.. _MIT Kerberos: http://web.mit.edu/kerberos/ +.. _cgit: http://git.zx2c4.com/cgit/about/ +.. _gitolite: http://gitolite.com diff --git a/src/sitemap1.xml b/src/sitemap1.xml index abffc65..83cdf95 100644 --- a/src/sitemap1.xml +++ b/src/sitemap1.xml @@ -6,4 +6,7 @@ <url> <loc>http://git.kyriasis.com</loc> </url> + <url> + <loc>https://theos.kyriasis.com:6697/</loc> + </url> </urlset> diff --git a/src/style.css b/src/style.css index 13a5255..07d8ad2 100644 --- a/src/style.css +++ b/src/style.css @@ -53,7 +53,7 @@ header h1 { color: #222; } -#content > p:first-of-type:first-letter { +#welcome-to-theos-kyriasis-com > p:first-of-type:first-letter { float: left; color: #903; font-size: 3rem; @@ -64,31 +64,34 @@ header h1 { font-family: 'Georgia'; } @media (max-width: 767px) { - #content > p:first-of-type:first-letter { + #welcome-to-theos-kyriasis-com > p:first-of-type:first-letter { padding-top: 0.3rem; padding-right: 0.2rem; font-size: 2.7rem; } } -#users h3 { +#user-pages h1 { margin: 0 0 -0.5rem 0; } -#users ul { +#user-pages ul { list-style-type: none; padding: 0 0 0 0.5rem; } - -#users ul li { +#user-pages ul li { padding-bottom: 0.25rem; } -.info-right { +p#last-upd, p#author { font-size: 14px; text-align: right; margin: 0; } +div.section h1 { + font-size: 19px; +} + .botborder { border-bottom: 0.15rem; border-bottom-style: dotted; diff --git a/src/templates/layout.html b/src/templates/layout.html new file mode 100644 index 0000000..22625f5 --- /dev/null +++ b/src/templates/layout.html @@ -0,0 +1,33 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="UTF-8"> + <title>{{ title }}</title> + <link href="style.css" rel="stylesheet"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <meta name="author" content="Johannes Löthberg"> + +{% block head %}{% endblock %} +</head> +<body itemscope itemtype="http://schema.org/WebPage"> +<header> + <nav> + <ul> + <li><a href="https://theos.kyriasis.com/">theos/</a></li> + <li><a href="http://git.kyriasis.com/">cgit/</a></li> + <li><a href="https://theos.kyriasis.com:6697/">znc/</a></li> + </ul> + </nav> + <h1>{{ header }}</h1> +</header> + +{% block content %}{% endblock %} +<footer> + <div id="foot-left"> + <p id="copy"> + © <span itemprop="copyrightYear">2014</span> + by <span itemprop="copyrightHolder">Johannes Löthberg</span> + </p> +</footer> +</body> +</html> diff --git a/src/templates/page.html b/src/templates/page.html new file mode 100644 index 0000000..3c5d29a --- /dev/null +++ b/src/templates/page.html @@ -0,0 +1,12 @@ +{% extends 'layout.html' %} + +{% block content %} + <article id="{{ page.article_id }}" class="botborder" itemprop="mainContentOfPage"> + + {{ page.body }} + + <p id="last-upd">Last updated <time itemprop="dateModified" datetime="{{ page.date }}">{{ page.date }}</time></p> + <p id="author"><a rel="author" href="{{ page.author_link }}">{{ page.author }}</a></p> + + </article> +{% endblock content %} |