summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuval Adam <_@yuv.al>2017-08-07 15:27:16 +0300
committerYuval Adam <_@yuv.al>2017-08-07 15:27:16 +0300
commit9d0a78bd95d3efdf6085581876b608d20d697eab (patch)
treedc57cfbb15d781205e17aa73df157b00c5dbc86d
parentbfed87461985a50898d0a00147d0147b59265a23 (diff)
Add intro blog post and logo in header
-rw-r--r--app.py10
-rw-r--r--static/css/main.css8
-rw-r--r--static/img/recycle.pngbin0 -> 3502 bytes
-rw-r--r--templates/base.html5
-rw-r--r--templates/blog-post.html2
-rw-r--r--templates/index.html3
6 files changed, 20 insertions, 8 deletions
diff --git a/app.py b/app.py
index 97fe702..fc4ab4a 100644
--- a/app.py
+++ b/app.py
@@ -23,15 +23,15 @@ def blog():
posts = map(parse_post, posts)
return render_template('blog.html', posts=posts)
-@app.route('/blog/<y>/<m>/<d>/<title>/')
-def blog_post(y, m, d, title):
- post_path = f'{y}-{m}-{d}-{title}'
+@app.route('/blog/<y>/<m>/<d>/<slug>/')
+def blog_post(y, m, d, slug):
+ post_path = f'{y}-{m}-{d}-{slug}'
with open(f'{BLOG_CONTENT_DIR}/{post_path}.md', 'r') as f:
text = f.read()
_, header, body = text.split('---')
- for h in header:
+ for h in header.split('\n'):
if h.startswith('title'):
- title = h.split('title:')[0].strip()
+ title = h.split('title:')[1].strip()
html = markdown.markdown(body, extensions=['markdown.extensions.extra', 'markdown.extensions.codehilite'])
return render_template('blog-post.html', title=title, html=html)
diff --git a/static/css/main.css b/static/css/main.css
index f70346b..57d46bc 100644
--- a/static/css/main.css
+++ b/static/css/main.css
@@ -1,3 +1,11 @@
+h1 img {
+ height: 1.4em;
+}
+
+h1 span {
+ vertical-align: top;
+}
+
div.menu ul {
list-style: none;
padding-left: 7px;
diff --git a/static/img/recycle.png b/static/img/recycle.png
new file mode 100644
index 0000000..7e4aa88
--- /dev/null
+++ b/static/img/recycle.png
Binary files differ
diff --git a/templates/base.html b/templates/base.html
index 06e79d4..a5cce9f 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -21,7 +21,10 @@
<body>
<div class="mw7 center">
<div class="cf ph2-ns">
- <h1 class="f2 lh-title">postmarketOS</h1>
+ <h1 class="f2 lh-title">
+ <img src="{{ url_for('static', filename='img/recycle.png') }}"></img>
+ <span>postmarketOS</span>
+ </h1>
<div class="menu">
<ul>
<li><a href="/">Home</a></li>
diff --git a/templates/blog-post.html b/templates/blog-post.html
index 7a24d02..9515768 100644
--- a/templates/blog-post.html
+++ b/templates/blog-post.html
@@ -1,6 +1,6 @@
{% extends 'base.html' %}
{% block body %}
-<h1>{{ title }}</h1>
+<h2>{{ title }}</h2>
{{ html|safe }}
{% endblock %}
diff --git a/templates/index.html b/templates/index.html
index 59c14e9..fd11861 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -5,7 +5,8 @@
<img src="{{ url_for('static', filename='img/banner.jpg') }}"></img>
</div>
<div class="fl w-100 w-50-ns pa2">
- <p class="intro">postmarketOS, or <i>pmOS</i> in short, is a touch-optimized, pre-configured <a href="https://alpinelinux.org">Alpine Linux</a> with own packages, that can be installed on smartphones (Not usable for most people yet!).</p>
+ <p class="intro">postmarketOS (<i>pmOS</i>), is a touch-optimized, pre-configured <a href="https://alpinelinux.org">Alpine Linux</a> that can be installed on smartphones and other mobile devices. The project is at very early stages of development and is not yet usable for most users.</p>
+ <p class="intro">For further details read our <a href="/blog/2017/05/26/intro/">introductory blog post</a>.</p>
<p>Find us on:</p>
<ul>
<li><a href="https://github.com/postmarketOS">GitHub</a></li>