summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile22
-rw-r--r--partials/footer.html24
-rw-r--r--partials/meta.html8
-rwxr-xr-xscripts/bupa93
-rw-r--r--src/about.html44
-rw-r--r--src/about.rst36
-rw-r--r--src/index.html26
-rw-r--r--src/index.rst9
-rw-r--r--src/journal.html56
-rw-r--r--src/journal/1-blogpost.rst16
-rw-r--r--src/journal/2-jellefant.rst11
-rw-r--r--src/journal/3-halosghost.rst11
-rw-r--r--src/resources/glider.png (renamed from resources/glider.png)bin724 -> 724 bytes
-rw-r--r--src/style.css22
-rw-r--r--src/templates/journal.html33
-rw-r--r--src/templates/layout.html36
-rw-r--r--src/templates/nav.html (renamed from partials/nav.html)0
-rw-r--r--src/templates/page.html17
18 files changed, 290 insertions, 174 deletions
diff --git a/Makefile b/Makefile
index d64c7e7..9deb502 100644
--- a/Makefile
+++ b/Makefile
@@ -12,24 +12,36 @@ site: $(addprefix build/, $(FILES))
clean:
-rm $(addprefix build/, $(FILES))
+build/index.html: src/index.rst
+ @./scripts/bupa index.html
+ @echo Built index.html
+
+build/about.html: src/about.rst
+ @./scripts/bupa about.html
+ @echo Built about.html
+
+build/journal.html: $(shell find src/journal)
+ @./scripts/bupa journal.html
+ @echo Built journal
+
build/%.html: src/%.html $(PARTIALS)
@./scripts/awink $< $@
@echo Compiled $< → $@
build/%.css: src/%.css
@install -Dm644 $< $@
- @echo Compiled $< → $@
+ @echo Copied $< → $@
-build/resources/%: resources/%
+build/resources/%: src/resources/%
@install -Dm644 $< $@
- @echo Compiled $< → $@
+ @echo Copied $< → $@
build/sitemap.xml: src/sitemap.xml
@install -Dm644 $< $@
- @echo Compiled $< → $@
+ @echo Copied $< → $@
build/pgp-key.txt: src/pgp-key.txt
@install -Dm644 $< $@
- @echo Compiled $< → $@
+ @echo Copied $< → $@
partials/%:
diff --git a/partials/footer.html b/partials/footer.html
deleted file mode 100644
index cb16f70..0000000
--- a/partials/footer.html
+++ /dev/null
@@ -1,24 +0,0 @@
-<footer>
-<div id="foot-left">
- <p id="copy">
- © <span itemprop="copyrightYear">2014</span>
- by <span itemprop="copyrightHolder">Johannes Löthberg</span>
- </p>
-
- <div id="contact-info-wrapper">
- <p>
- You can find me on:
- </p>
- <div id="contact-info">
- <a rel="me" href="mailto:johannes@kyriasis.com">Email</a>
- <a rel="me" href="https://twitter.com/kyriasis">Twitter</a>
- <a rel="me" href="https://plus.google.com/+JohannesLothberg">Google+</a>
- <a rel="me" href="sms:+46739525259">SMS</a>
- </div>
- </div>
-</div>
-
-<a id="emblem" href="http://www.catb.org/hacker-emblem/">
- <img src="resources/glider.png" alt="hacker emblem" />
-</a>
-</footer>
diff --git a/partials/meta.html b/partials/meta.html
deleted file mode 100644
index 71b20ad..0000000
--- a/partials/meta.html
+++ /dev/null
@@ -1,8 +0,0 @@
-<link href="style.css" rel="stylesheet">
-
-<meta name="viewport" content="width=device-width, initial-scale=1.0">
-
-<meta name="author" content="Johannes Löthberg">
-
-<link rel="me" href="https://theos.kyriasis.com/~kyrias/about.html"
- title="Johannes Löthberg <johannes@kyriasis.com>">
diff --git a/scripts/bupa b/scripts/bupa
new file mode 100755
index 0000000..eca289a
--- /dev/null
+++ b/scripts/bupa
@@ -0,0 +1,93 @@
+#!/usr/bin/env python
+"""Usage: bupa <filename>
+
+Options:
+ -h --help Show this screen.
+"""
+from jinja2 import Environment, FileSystemLoader
+import os, 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 Entry(object):
+ def __init__(self, entry_dict):
+ self.id = None
+ self.title = entry_dict['title']
+ self.date = entry_dict['date']
+ self.author = entry_dict['author']
+ if 'author_link' in entry_dict:
+ self.author_link = entry_dict['author_link']
+ self.body = entry_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)
+
+ entry_dict = frontmatter.copy()
+ entry_dict['body'] = body
+
+ entry = Entry(entry_dict)
+ return entry
+
+def build_journal(env):
+ template = env.get_template('journal.html')
+
+ files = os.listdir('src/journal')
+ files.sort(key=filename_to_id, reverse=True)
+
+ entries = []
+ for file in files:
+ entry = parse('src/journal/' + file)
+ entry.body = reST_to_html(entry.body)
+ entry.id = filename_to_id(file)
+ entries += [entry]
+
+ with open('build/journal.html', 'w') as file:
+ file.write(template.render(entries=entries, title='~/journal'))
+
+def build_index(env):
+ template = env.get_template('page.html')
+
+ page = parse('src/index.rst')
+ page.body = reST_to_html(page.body)
+ page.article_id = 'index'
+
+ with open('build/index.html', 'w') as file:
+ file.write(template.render(page=page, title=page.title))
+
+def build_about(env):
+ template = env.get_template('page.html')
+
+ page = parse('src/about.rst')
+ page.body = reST_to_html(page.body)
+ page.article_id = 'about'
+
+ with open('build/about.html', 'w') as file:
+ file.write(template.render(page=page, title='~/about'))
+
+def main():
+ arguments = docopt.docopt(__doc__)
+ env = Environment(loader=FileSystemLoader('src/templates'))
+
+ if arguments['<filename>'] == 'journal.html':
+ build_journal(env)
+ elif arguments['<filename>'] == 'index.html':
+ build_index(env)
+ elif arguments['<filename>'] == 'about.html':
+ build_about(env)
+
+if __name__ == '__main__':
+ main()
diff --git a/src/about.html b/src/about.html
deleted file mode 100644
index c90458f..0000000
--- a/src/about.html
+++ /dev/null
@@ -1,44 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <meta charset="UTF-8">
- <title>~/about</title>
-%include partials/meta.html
-</head>
-<body itemscope itemtype="http://schema.org/WebPage">
- <header>
-%include partials/nav.html
- <h1>About me</h1>
- </header>
-
- <article id="about" class="botborder" itemprop="mainContentOfPage">
- <p>
- I'm “kyrias”, also commonly known online as “demize”, but you can call me “Johannes Löthberg” if you’d like. Though if you ask my local government my last name doesn’t actually contain an ‘h’, which I find quite annoying. Anyway, I’m currently 18 years old, and I come from Sweden and have lived here my whole life.
- </p>
-
- <p>
- Online you can find me in various places under different names, though in almost all cases under one of the previously mentioned ones. I’m most commonly found on <a href="http://tools.ietf.org/html/rfc1459">IRC</a> as “demize”, and tend to hang out in the <a href="https://archlinux.org/">Arch Linux</a> <a href="ircs://chat.freenode.net/archlinux">channels</a> on the <a href="https://freenode.net/">freenode</a> IRC network, where I somehow ended up as a channel operator, but you will also sometimes find me in different places like on <a href="https://unix.stackexchange.com/">unix.SE</a> where I go by the name <a href="http://unix.stackexchange.com/users/33521" rel="me">kyrias</a>.
- </p>
-
- <p>
- I also have a few <a href="http://git-scm.com/">Git</a> repositories hosted on <a href="https://github.com/">GitHub</a>, where I go by the nick <a href="https://github.com/kyrias" rel="me">kyrias</a>, in addition to the ones hosted on the kyriasis <a href="http://git.kyriasis.com/">git hosting</a> service, though you likely won’t find anything interesting in either place since I haven’t really made anything interesting to put up there. <sup><span class="small-text">(yet?)</span></sup>
- </p>
-
- <p>
- I also maintain a couple of packages in the <a href="https://aur.archlinux.org/">AUR</a>, the Arch User Repository, which is a repository of community contributed PKGBUILDs for the Arch Linux distribution. Some of the packages are for software I use myself, others are packages that other maintainers haven’t taken care of, and the rest are packages that other people have requested to be created.
- </p>
-
- <h3>Contact</h3>
- <p>
- You can contact me through email at <a href="mailto:johannes@kyriasis.com">johannes@kyriasis.com</a>, through my <a href="https://plus.google.com/+JohannesLothberg">Google+ profile</a>, or through IRC where I tend to hang out as demize, mainly on the <a href="https://freenode.net/">freenode</a> but sometimes also on the <a href="http://foonetic.net/">Foonetic</a> IRC networks.
- <p>
- Before contacting me through email consider getting my PGP key from either <a href="pgp-key.txt">this link</a> or fetching it from a keyserver using the key ID 0x50FB9B273A9D0BB5 and signing and/or encrypting your email to me.
- </p>
- <p id="last-upd">Last updated <time itemprop="dateModified" datetime="2014-10-12">2014-10-12</time></p>
- <p id="author"><a rel="author" href="about.html">Johannes Löthberg</a></p>
-
- </article>
-
-%include partials/footer.html
-</body>
-</html>
diff --git a/src/about.rst b/src/about.rst
new file mode 100644
index 0000000..ddcde05
--- /dev/null
+++ b/src/about.rst
@@ -0,0 +1,36 @@
+.. frontmatter
+ title: About me
+ date: 2014-10-14
+ author: Johannes Löthberg
+
+I'm “kyrias”, also commonly known online as “demize”, but you can call me “Johannes Löthberg” if you’d like. Though if you ask my local government my last name doesn’t actually contain an ‘h’, which I find quite annoying. Anyway, I’m currently 18 years old, and I come from Sweden and have lived here my whole life.
+
+Online you can find me in various places under different names, though in almost all cases under one of the previously mentioned ones. I’m most commonly found on IRC_ as “demize”, and tend to hang out in the `Arch Linux`_ channels_ on the freenode_ IRC network, where I somehow ended up as a channel operator, but you will also sometimes find me in different places like on unix.SE_ where I go by the name kyrias_.
+
+I also have a few Git_ repositories hosted on my `GitHub account`_ in addition to the ones hosted on the kyriasis `git hosting`_ service, though you likely won’t find anything interesting in either place since I haven’t really made anything interesting to put up there. :sup:`(yet?)`
+
+I also maintain a couple of packages in the AUR_, the Arch User Repository, which is a repository of community contributed PKGBUILDs for the Arch Linux distribution. Some of the packages are for software I use myself, others are packages that other maintainers haven’t taken care of, and the rest are packages that other people have requested to be created.
+
+Contact
+-------
+
+You can contact me through email at `johannes@kyriasis.com`_, through my `Google+ profile`_, or through IRC where I tend to hang out as demize, mainly on the freenode_ but sometimes also on the Foonetic_ IRC networks.
+
+Before contacting me through email consider getting my PGP key from either `this link`_ or fetching it from a keyserver using the key ID 0x50FB9B273A9D0BB5 and signing and/or encrypting your email to me.
+
+.. role:: sup
+
+.. _IRC: http://tools.ietf.org/html/rfc1459
+.. _Arch Linux: https://archlinux.org/
+.. _channels: ircs://chat.freenode.net/archlinux
+.. _freenode: https://freenode.net/
+.. _unix.SE: http://unix.stackexchange.com/
+.. _kyrias: http://unix.stackexchange.com/users/33521
+.. _Git: http://git-scm.com/
+.. _GitHub account: https://github.com/kyrias
+.. _git hosting: http://git.kyriasis.com/
+.. _AUR: https://aur.archlinux.org/
+.. _johannes@kyriasis.com: mailto:johannes@kyriasis.com
+.. _Google+ profile: https://plus.google.com/+JohannesLothberg
+.. _Foonetic: http://foonetic.net/
+.. _this link: pgp-key.txt
diff --git a/src/index.html b/src/index.html
deleted file mode 100644
index a848742..0000000
--- a/src/index.html
+++ /dev/null
@@ -1,26 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <meta charset="UTF-8">
- <title>~kyrias/</title>
-%include partials/meta.html
-</head>
-<body itemscope itemtype="http://schema.org/WebPage">
- <header>
-%include partials/nav.html
- <h1>~kyrias/</h1>
- </header>
-
- <article id="about" class="botborder">
- <p>
- Hello there, welcome to my empty corner of the Internet. There isn't really anything up here yet, and there likely never will be either for that matter, but feel free to check out my <a href="journal.html">journal</a> where I guess I’m supposed to actually write entries, and my <a href="about.html">about</a> page if you for some reason want to read more about me.
- </p>
-
- <p id="last-upd">Last updated <time itemprop="dateModified" datetime="2014-10-10">2014-10-10</time></p>
- <p id="author"><a rel="author" href="about.html">Johannes Löthberg</a></p>
-
- </article>
-
-%include partials/footer.html
-</body>
-</html>
diff --git a/src/index.rst b/src/index.rst
new file mode 100644
index 0000000..a57a4ae
--- /dev/null
+++ b/src/index.rst
@@ -0,0 +1,9 @@
+.. frontmatter
+ title: ~kyrias/
+ date: 2014-10-14
+ author: Johannes Löthberg
+
+Hello there, welcome to my empty corner of the Internet. There isn't really anything up here yet, and there likely never will be either for that matter, but feel free to check out my journal_ where I guess I’m supposed to actually write entries, and my about_ page if you for some reason want to read more about me.
+
+.. _journal: journal.html
+.. _about: about.html
diff --git a/src/journal.html b/src/journal.html
deleted file mode 100644
index 65ec807..0000000
--- a/src/journal.html
+++ /dev/null
@@ -1,56 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <meta charset="UTF-8">
- <title>~/journal</title>
-%include partials/meta.html
-</head>
-<body itemscope itemtype="http://schema.org/WebPage">
- <header>
-%include partials/nav.html
- <h1>The lost journal</h1>
- </header>
-
-
- <article itemscope itemtype="http://schema.org/Article"
- class="post" id="post:1">
- <h2 itemprop="name" class="title">Blogpost</h2>
- <div class="info">
- Published on <time itemprop="datePublished" datetime="2014-08-22T09:50:23Z">2014-08-22 09:50 UTC</time>
- <span itemprop="author" itemscope itemtype="http://schema.org/Person">
- by <a itemprop="name" rel="author" href="about.html">Johannes Löthberg</a>
- </span>
- </div>
-
- <p>Developers developers developers developers developers developers
- developers developers developers developers developers DEVELOPERS open
- source microsoft excel. Leadership i have never honestly thrown a chair
- in my life open source i don't know what a monopoly is no i do not have
- an ipod most people steal music windows phone linux is a cancer. Open
- source DEVELOPERS most people steal music leadership. Innovation
- outlook vista windows open source bing. DEVELOPERS developers
- developers developers developers developers developers developers
- developers developers developers developers winning Zune programming
- open source vista linux is not in the public domain innovation.</p>
- </article>
-
- <article itemscope itemtype="http://schema.org/Article"
- class="post" id="post:2">
- <h2 itemprop="name" class="title">jellefant</h2>
- <div class="info">
- Published on <time itemprop="datePublished" datetime="2014-10-10T09:50:23Z">2014-10-10 09:50 UTC</time>
- <span itemprop="author" itemscope itemtype="http://schema.org/Person">
- by <a itemprop="name" rel="author" href="about.html">Johannes Löthberg</a>
- </span>
- </div>
-
- <p>I don't actually have anything at all to write here. So why am I even making this? Who the hell knows?!</p>
-
- <p>Jelle is a jellefant ❤</p>
-
- <p>And of course dagle is a hugosaur ❤</p>
- </article>
-
-%include partials/footer.html
-</body>
-</html>
diff --git a/src/journal/1-blogpost.rst b/src/journal/1-blogpost.rst
new file mode 100644
index 0000000..014fb21
--- /dev/null
+++ b/src/journal/1-blogpost.rst
@@ -0,0 +1,16 @@
+.. frontmatter
+ title: Blogpost
+ date: 2014-08-22
+ author: Johannes Löthberg
+ author_link: about.html
+
+Developers developers developers developers developers developers
+developers developers developers developers developers DEVELOPERS open
+source microsoft excel. Leadership i have never honestly thrown a chair
+in my life open source i don't know what a monopoly is no i do not have
+an ipod most people steal music windows phone linux is a cancer. Open
+source DEVELOPERS most people steal music leadership. Innovation
+outlook vista windows open source bing. DEVELOPERS developers
+developers developers developers developers developers developers
+developers developers developers developers winning Zune programming
+open source vista linux is no
diff --git a/src/journal/2-jellefant.rst b/src/journal/2-jellefant.rst
new file mode 100644
index 0000000..e64e58c
--- /dev/null
+++ b/src/journal/2-jellefant.rst
@@ -0,0 +1,11 @@
+.. frontmatter
+ title: jellefant
+ date: 2014-10-10
+ author: Johannes Löthberg
+ authorUrl: https://theos.kyriasis.com/~kyrias/about.html
+
+I don't actually have anything at all to write here. So why am I even making this? Who the hell knows?!
+
+Jelle is a jellefant ❤
+
+And of course dagle is a hugosaur ❤
diff --git a/src/journal/3-halosghost.rst b/src/journal/3-halosghost.rst
new file mode 100644
index 0000000..068160d
--- /dev/null
+++ b/src/journal/3-halosghost.rst
@@ -0,0 +1,11 @@
+.. frontmatter
+ title: Halosghostsomething
+ date: 2014-10-13
+ author: Johannes Löthberg
+ author_link: about.html
+
+Wooh, halosghost_ is awesome and stuff and some other things... I need something better to do than trying to come up with fake entries. “<halosghost> I am awesome.”
+
+Somethingsomethingsomething
+
+.. _halosghost: http://halosgho.st
diff --git a/resources/glider.png b/src/resources/glider.png
index fd3a86f..fd3a86f 100644
--- a/resources/glider.png
+++ b/src/resources/glider.png
Binary files differ
diff --git a/src/style.css b/src/style.css
index ad71adc..1784d6f 100644
--- a/src/style.css
+++ b/src/style.css
@@ -48,30 +48,30 @@ header h1 {
margin: 0;
}
-.post, .botborder {
+.entry, .botborder {
margin-bottom: 1rem;
border-bottom: 0.15rem;
border-bottom-style: dotted;
border-bottom-color: #bbb;
}
-.post {
+.entry {
color: #222;
}
-.post .title {
+.entry .title {
font-size: 1.4rem;
- margin-top: 0;
+ margin-top: 0.3rem;
margin-bottom: 0.3rem;
}
-.post .info {
+.entry .info {
font-size: 0.9rem;
color: #505050;
margin-bottom: -0.4rem;
}
-.post > p:first-of-type:first-letter {
+.entry div > p:first-of-type:first-letter {
float: left;
color: #903;
- font-size: 3rem;
+ font-size: 2.8rem;
line-height: 2rem;
padding-top: 0.4rem;
padding-right: 0.4rem;
@@ -79,24 +79,24 @@ header h1 {
font-family: 'Georgia';
}
@media (max-width: 767px) {
- .post > p:first-of-type:first-letter {
+ .entry div > p:first-of-type:first-letter {
padding-top: 0.3rem;
padding-right: 0.2rem;
font-size: 2.7rem;
}
}
-#about {
+#index, #about {
padding-bottom: 0.5rem;
color: #222;
}
-#about p#last-upd {
+p#last-upd {
font-size: 14px;
text-align: right;
margin: 0;
}
-#about p#author {
+p#author {
font-size: 14px;
text-align: right;
margin: 0;
diff --git a/src/templates/journal.html b/src/templates/journal.html
new file mode 100644
index 0000000..0269d2e
--- /dev/null
+++ b/src/templates/journal.html
@@ -0,0 +1,33 @@
+{% extends 'layout.html' %}
+
+{% block content %}
+ <header>
+{% include 'nav.html' %}
+ <h1>The lost journal</h1>
+ </header>
+
+{% for entry in entries %}
+ <article itemscope itemtype="http://schema.org/Article"
+ class="entry" id="entry:{{ entry.id }}">
+
+ <h2 itemprop="name" class="title">{{ entry.title }}</h2>
+
+ <div class="info">
+ Published on
+ <time itemprop="datePublished" datetime="{{ entry.date.strftime('%Y-%m-%d') }}">
+ {{ entry.date.strftime('%Y-%m-%d') }}
+ </time>
+
+ <span itemprop="author" itemscope itemtype="http://schema.org/Person">
+ {% if entry.author_link %}
+ by <a itemprop="name" rel="author" href="{{ entry.author_link }}">{{ entry.author }}</a>
+ {% else %}
+ by {{ entry.author }}
+ {% endif %}
+ </span>
+ </div>
+
+ {{ entry.body }}
+ </article>
+{% endfor %}
+{% endblock content %}
diff --git a/src/templates/layout.html b/src/templates/layout.html
new file mode 100644
index 0000000..45ab99d
--- /dev/null
+++ b/src/templates/layout.html
@@ -0,0 +1,36 @@
+<!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">
+ <link rel="me" href="https://theos.kyriasis.com/~kyrias/about.html"
+ title="Johannes Löthberg <johannes@kyriasis.com>">
+</head>
+<body itemscope itemtype="http://schema.org/WebPage">
+{% 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>
+
+ <div id="contact-info-wrapper">
+ <p>You can find me on:</p>
+ <div id="contact-info">
+ <a rel="me" href="mailto:johannes@kyriasis.com">Email</a>
+ <a rel="me" href="https://twitter.com/kyriasis">Twitter</a>
+ <a rel="me" href="https://plus.google.com/+JohannesLothberg">Google+</a>
+ <a rel="me" href="sms:+46739525259">SMS</a>
+ </div>
+ </div>
+ </div>
+ <a id="emblem" href="http://www.catb.org/hacker-emblem/">
+ <img src="resources/glider.png" alt="hacker emblem" />
+ </a>
+</footer>
+</body>
+</html>
diff --git a/partials/nav.html b/src/templates/nav.html
index e40b4ed..e40b4ed 100644
--- a/partials/nav.html
+++ b/src/templates/nav.html
diff --git a/src/templates/page.html b/src/templates/page.html
new file mode 100644
index 0000000..9e0dddc
--- /dev/null
+++ b/src/templates/page.html
@@ -0,0 +1,17 @@
+{% extends 'layout.html' %}
+
+{% block content %}
+ <header>
+{% include 'nav.html' %}
+ <h1>{{ page.title }}</h1>
+ </header>
+
+ <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 %}