aboutsummaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
Diffstat (limited to 'templates')
-rw-r--r--templates/archive.html14
-rw-r--r--templates/base.html30
-rw-r--r--templates/index.html5
-rw-r--r--templates/page.html10
-rw-r--r--templates/weblog.html27
5 files changed, 86 insertions, 0 deletions
diff --git a/templates/archive.html b/templates/archive.html
new file mode 100644
index 0000000..68daf65
--- /dev/null
+++ b/templates/archive.html
@@ -0,0 +1,14 @@
+{% extends "base.html" %}
+{% block content %}
+{% set section = get_section(path="weblog/_index.md") %}
+<div class="posts-list">
+ {% for year, posts in section.pages | group_by(attribute="year") %}
+ <h2>{{ year }}</h2>
+ <ul>
+ {% for post in posts %}
+ <li>{{ post.date }} - <a href="{{ post.permalink }}">{{ post.title }}</a></li>
+ {% endfor %}
+ </ul>
+ {% endfor %}
+</div>
+{% endblock %}
diff --git a/templates/base.html b/templates/base.html
new file mode 100644
index 0000000..f03965f
--- /dev/null
+++ b/templates/base.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta content="width=device-width, initial-scale=1" name="viewport">
+ <title>{{ config.title }}</title>
+ <link rel="stylesheet" href="{{ get_url(path="css/yaroslavps.css") }}">
+ <link rel="icon" type="image/png" href="{{ get_url(path="favicon32x32.png") }}">
+ <link rel="icon" type="image/png" href="{{ get_url(path="favicon64x64.png") }}">
+ {% block extrahead %}
+ {% endblock %}
+ </head>
+ <body>
+ <div class="main-container">
+ <div class="header-container">
+ <h1><a href="/">Yaroslav de la Peña Smirnov</a></h1>
+ </div>
+ {% block page %}
+ <div class="content-container">
+ {% block content %}
+ {% endblock %}
+ </div>
+ <div class="sidebar-container">
+ <p>Hello, my name is Yaroslav de la Peña Smirnov. Welcome to my weblog.</p>
+ <a href="/weblog/archive">Archive</a>
+ </div>
+ {% endblock %}
+ </div>
+ </body>
+</html>
diff --git a/templates/index.html b/templates/index.html
new file mode 100644
index 0000000..0d9fb7c
--- /dev/null
+++ b/templates/index.html
@@ -0,0 +1,5 @@
+{% extends "base.html" %}
+{% block page %}
+<h2>Welcome to my site!</h2>
+<a href="/weblog">Go to weblog</a>
+{% endblock %}
diff --git a/templates/page.html b/templates/page.html
new file mode 100644
index 0000000..66faa93
--- /dev/null
+++ b/templates/page.html
@@ -0,0 +1,10 @@
+{% extends "base.html" %}
+{% block content %}
+{% set post = page %}
+<div class="post-page">
+ <h2>{{ post.title }}</h2>
+ <p class="publish-date">{{ post.date }}</p>
+ <hr>
+ {{ post.content | safe }}
+</div>
+{% endblock %}
diff --git a/templates/weblog.html b/templates/weblog.html
new file mode 100644
index 0000000..11c0d2a
--- /dev/null
+++ b/templates/weblog.html
@@ -0,0 +1,27 @@
+{% extends "base.html" %}
+{% block content %}
+<div class="posts-list">
+ {% for post in paginator.pages %}
+ <div class="post-preview">
+ <h2><a href="{{ post.permalink }}">{{ post.title }}</a></h2>
+ {% if post.summary %}
+ {{ post.summary | safe }}
+ {% endif %}
+ </div>
+ {% endfor %}
+</div>
+{% if paginator %}
+{% if paginator.number_pagers > 1 %}
+<div class="paginator">
+ {% if paginator.previous %}
+ <a href="{{ paginator.first }}">First</a>
+ <a href="{{ paginator.previous }}">Previous page: {{ paginator.current_index - 1 }}</a>
+ {% endif %}
+ {% if paginator.next %}
+ <a href="{{ paginator.next }}">Next page: {{ paginator.current_index + 1 }}</a>
+ <a href="{{ paginator.last }}">Last</a>
+ {% endif %}
+</div>
+{% endif %}
+{% endif %}
+{% endblock %}