.main {
display: flex;
- gap: 30px;
+ gap: 15px;
align-items: flex-start;
margin-top: 10px;
}
.content {
flex: 1;
min-width: 0;
+}
+
+/* A plain box for non-post content listings (archives, tags, categories) */
+.content-box {
background-color: #fff;
padding: 20px;
box-shadow: 0 3px 8px rgba(0,0,0,0.25);
}
-/* Posts */
+/* Posts: each one is its own box, sitting on the page's gray background */
.post {
- margin-bottom: 40px;
+ background-color: #fff;
+ padding: 20px;
+ margin-bottom: 15px;
+ box-shadow: 0 3px 8px rgba(0,0,0,0.25);
}
.post:last-child {
/* Pagination */
.pagination {
- margin-top: 30px;
- padding-top: 15px;
- border-top: 1px solid #ddd;
+ margin-top: 10px;
+ padding: 15px 20px;
+ background-color: #fff;
+ box-shadow: 0 3px 8px rgba(0,0,0,0.25);
display: flex;
- justify-content: space-between;
+ flex-wrap: wrap;
+ align-items: center;
+ gap: 10px;
+ font-size: 13px;
+}
+
+.pagination .page-count {
+ color: #999;
+ margin-right: 10px;
+}
+
+.pagination a {
+ padding: 2px 4px;
+}
+
+.pagination .current {
+ font-weight: bold;
+ color: #222;
+ padding: 2px 4px;
}
/* Footer */
font-size: 12px;
}
+footer p {
+ margin-bottom: 6px;
+}
+
+footer p:last-child {
+ margin-bottom: 0;
+}
+
+footer a {
+ color: #999;
+ text-decoration: underline;
+}
+
/* Responsive */
@media (max-width: 768px) {
.main {
{% block title %}{{ SITENAME }} - Archives{% endblock %}
{% block content %}
+ <div class="content-box">
<h2 class="archive-title">Archives</h2>
{% for year, year_articles in dates|groupby('date.year')|reverse %}
<h3 class="archive-year">{{ year }}</h3>
{% endfor %}
</ul>
{% endfor %}
+ </div>
{% endblock %}
{% block title %}{{ article.title }} - {{ SITENAME }}{% endblock %}
+{% block extra_head %}
+<link rel="alternate" type="text/markdown" title="Markdown version" href="{{ SITEURL }}/{{ article.markdown_url }}">
+{% endblock %}
+
{% block content %}
{{ post_card.render_post(article) }}
{% endblock %}
{% block title %}{{ SITENAME }} - Authors{% endblock %}
{% block content %}
+ <div class="content-box">
<h2 class="archive-title">Authors</h2>
<ul class="archive-list">
{% for author, articles in authors|sort %}
<li><a href="{{ SITEURL }}/{{ author.url }}">{{ author }}</a> ({{ articles|count }})</li>
{% endfor %}
</ul>
+ </div>
{% endblock %}
{% if FEED_ALL_ATOM %}
<link rel="alternate" type="application/atom+xml" title="{{ SITENAME }} Full Atom Feed" href="{{ SITEURL }}/{{ FEED_ALL_ATOM }}">
{% endif %}
+ {% block extra_head %}{% endblock %}
<script>
MathJax = { tex: { inlineMath: [['\\(', '\\)']], displayMath: [['$$', '$$']] } };
</script>
<footer>
<div class="container">
- <p>© {{ SITENAME }}</p>
+ <p class="license">This work is licensed under a <a rel="license" href="https://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International License</a>.</p>
+ <p>© {{ AUTHOR }}</p>
</div>
</footer>
</body>
{% block title %}{{ SITENAME }} - Categories{% endblock %}
{% block content %}
+ <div class="content-box">
<h2 class="archive-title">Categories</h2>
<ul class="archive-list">
{% for category, articles in categories %}
<li><a href="{{ SITEURL }}/{{ category.url }}">{{ category }}</a> ({{ articles|count }})</li>
{% endfor %}
</ul>
+ </div>
{% endblock %}
--- /dev/null
+{% macro render_pagination(page, paginator) %}
+{% if paginator.num_pages > 1 %}
+<nav class="pagination">
+ <span class="page-count">Page {{ page.number }} of {{ paginator.num_pages }}</span>
+ {% if page.number > 1 %}
+ <a href="{{ SITEURL }}/{{ paginator.page(1).url }}">« First</a>
+ <a href="{{ SITEURL }}/{{ paginator.page(page.number - 1).url }}">‹ Prev</a>
+ {% endif %}
+ {% set window = 3 %}
+ {% for n in range([1, page.number - window]|max, [paginator.num_pages, page.number + window]|min + 1) %}
+ {% if n == page.number %}
+ <span class="current">{{ n }}</span>
+ {% else %}
+ <a href="{{ SITEURL }}/{{ paginator.page(n).url }}">{{ n }}</a>
+ {% endif %}
+ {% endfor %}
+ {% if page.number < paginator.num_pages %}
+ <a href="{{ SITEURL }}/{{ paginator.page(page.number + 1).url }}">Next ›</a>
+ <a href="{{ SITEURL }}/{{ paginator.page(paginator.num_pages).url }}">Last »</a>
+ {% endif %}
+</nav>
+{% endif %}
+{% endmacro %}
{% extends "base.html" %}
{% import "includes/post_card.html" as post_card %}
+{% import "includes/pagination.html" as pagination %}
{% block content %}
{% block content_title %}{% endblock %}
{{ post_card.render_post(article) }}
{% endfor %}
- {% if articles_page.has_previous() or articles_page.has_next() %}
- <nav class="pagination">
- {% if articles_page.has_previous() %}
- <a href="{{ SITEURL }}/{{ articles_previous_page.url }}">← Newer</a>
- {% else %}
- <span></span>
- {% endif %}
- {% if articles_page.has_next() %}
- <a href="{{ SITEURL }}/{{ articles_next_page.url }}">Older →</a>
- {% endif %}
- </nav>
- {% endif %}
+ {{ pagination.render_pagination(articles_page, articles_paginator) }}
{% endblock %}
{% block title %}{{ SITENAME }} - Tags{% endblock %}
{% block content %}
+ <div class="content-box">
<h2 class="archive-title">Tags</h2>
<ul class="archive-list">
{% for tag, articles in tags|sort %}
<li><a href="{{ SITEURL }}/{{ tag.url }}">{{ tag }}</a> ({{ articles|count }})</li>
{% endfor %}
</ul>
+ </div>
{% endblock %}