Skip to content
Snippets Groups Projects
Commit 28ff5a1d authored by Nikos Roussos's avatar Nikos Roussos
Browse files

Add some basic blog archive page

parent 03744ee0
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -72,6 +72,9 @@ def generate_posts():
year = str(datetime.tm_year)
month = ('0' + str(datetime.tm_mon) if datetime.tm_mon < 10 else str(datetime.tm_mon))
day = ('0' + str(datetime.tm_mday) if datetime.tm_mday < 10 else str(datetime.tm_mday))
shortdate = str.join('.', (year, month, day))
postpath = path.join(year, month, day)
try:
makedirs(postpath)
Loading
Loading
@@ -83,6 +86,7 @@ def generate_posts():
 
post_object = dict(
date=date,
shortdate=shortdate,
title=headers['title'],
slug=headers['slug'],
tags=tags,
Loading
Loading
{% extends "base.html" %}
 
{% block content %}
<div class="row">
<div class="col-md-12 text-center">
<p>Hi, I'm {{ author }}.</p>
<div class="container">
<div class="row">
<div class="col-md-12 text-center">
<p>Hi, I'm {{ author }}.</p>
</div>
</div>
</div>
{% endblock %}
Loading
Loading
@@ -21,7 +21,7 @@
<div class="col-md-12 text-center">
<p><img src="/static/img/avatar.png" alt="{{ author }}" class="img-circle" /></p>
 
<a href="/index.html">Home</a> &bull;
<a href="/index.html">About</a> &bull;
<a href="/blog.html">Blog</a>
</div>
</div>
Loading
Loading
Loading
Loading
@@ -2,23 +2,20 @@
 
{% block content %}
<div class="container">
<h3>Posts</h3>
<h3>Blog</h3>
 
<table class="table table-striped">
<thead>
<table class="table table-responsive">
{% for post in posts %}
<tr>
<th>Date</th>
<th>Title</th>
<td id="pubdate">{{ post['shortdate'] }}</td>
<td>
<a href="{{ post.link }}">{{ post.title }}</a><br>
{% for tag in post.tags %}
<span class="text-muted">#{{ tag }}</span>&nbsp;
{% endfor %}
</td>
</tr>
</thead>
<tbody>
{% for post in posts %}
<tr>
<td>{{ post['date'] }}</td>
<td><a href="{{ post.link }}">{{ post.title }}</a></td>
</tr>
{% endfor %}
</tbody>
{% endfor %}
</table>
</div>
{% endblock %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment