mirror of
https://github.com/andwati/andwati.com.git
synced 2026-11-27 19:08:46 +00:00
completed pagination
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
+++
|
+++
|
||||||
sort_by = "date"
|
sort_by = "date"
|
||||||
template= "archive.html"
|
template= "archive.html"
|
||||||
|
paginate_by= 10
|
||||||
+++
|
+++
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
pre {
|
||||||
|
display: block;
|
||||||
|
padding: 0.25rem 1.25rem;
|
||||||
|
font-size: 85%;
|
||||||
|
border-left: 0.25rem solid var(--primary-accent-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
code {
|
||||||
|
padding: 0 0.4rem;
|
||||||
|
// background-color: #3c3836;
|
||||||
|
background-color: var(--inline-code-background-color);
|
||||||
|
/* Inline code blocks look less aggresive with a little rounding. */
|
||||||
|
border-radius: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
pre, code {
|
||||||
|
overflow: auto;
|
||||||
|
font-family: var(--default-mono-font);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Without this the <code> tag gains a little padding that offsets text by like
|
||||||
|
2 pixels. Let's *not* do that. */
|
||||||
|
pre > code {
|
||||||
|
padding: 0;
|
||||||
|
background-color: var(--code-background-color);
|
||||||
|
// Code inside a pre block doesn't need rounded borders.
|
||||||
|
border-radius: unset;
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
.pagination{
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
list-style: none;
|
||||||
|
|
||||||
|
.page-item .disabled{
|
||||||
|
opacity: 0.5;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-numbers{
|
||||||
|
font-size: 0.9rem;
|
||||||
|
color: var(--link-color);
|
||||||
|
}
|
||||||
|
}
|
||||||
+4
-32
@@ -5,10 +5,13 @@
|
|||||||
- Serve fonts from the local server rather than Google's API.
|
- Serve fonts from the local server rather than Google's API.
|
||||||
- Support a "display title" in an [extra] section to allow for <br> elements
|
- Support a "display title" in an [extra] section to allow for <br> elements
|
||||||
or other manual control over title display. */
|
or other manual control over title display. */
|
||||||
|
|
||||||
@charset "utf-8";
|
@charset "utf-8";
|
||||||
|
@use '_pagination.scss';
|
||||||
|
@use '_codeblocks.scss';
|
||||||
|
|
||||||
@import url('https://fonts.googleapis.com/css?family=Noto+Sans|Noto+Serif|Noto+Sans+Mono');
|
@import url('https://fonts.googleapis.com/css?family=Noto+Sans|Noto+Serif|Noto+Sans+Mono');
|
||||||
|
|
||||||
|
|
||||||
:root {
|
:root {
|
||||||
/* Fonts and Text Sizes */
|
/* Fonts and Text Sizes */
|
||||||
--default-serif-font: "Noto Serif", serif;
|
--default-serif-font: "Noto Serif", serif;
|
||||||
@@ -165,37 +168,6 @@
|
|||||||
color: var(--muted-color);
|
color: var(--muted-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---- Code blocks ---------------------------------------------------------*/
|
|
||||||
|
|
||||||
pre {
|
|
||||||
display: block;
|
|
||||||
padding: 0.25rem 1.25rem;
|
|
||||||
font-size: 85%;
|
|
||||||
border-left: 0.25rem solid var(--primary-accent-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
code {
|
|
||||||
padding: 0 0.4rem;
|
|
||||||
// background-color: #3c3836;
|
|
||||||
background-color: var(--inline-code-background-color);
|
|
||||||
/* Inline code blocks look less aggresive with a little rounding. */
|
|
||||||
border-radius: 2px;
|
|
||||||
}
|
|
||||||
|
|
||||||
pre, code {
|
|
||||||
overflow: auto;
|
|
||||||
font-family: var(--default-mono-font);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Without this the <code> tag gains a little padding that offsets text by like
|
|
||||||
2 pixels. Let's *not* do that. */
|
|
||||||
pre > code {
|
|
||||||
padding: 0;
|
|
||||||
background-color: var(--code-background-color);
|
|
||||||
// Code inside a pre block doesn't need rounded borders.
|
|
||||||
border-radius: unset;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ---- Tables --------------------------------------------------------------*/
|
/* ---- Tables --------------------------------------------------------------*/
|
||||||
|
|
||||||
table {
|
table {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
{% extends "section.html" %}
|
{% extends "section.html" %}
|
||||||
{% import "post_macros.html" as page_macros %}
|
{% import "post_macros.html" as page_macros %}
|
||||||
|
{% import "paginate.html" as paginate_macro %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<main id="content">
|
<main id="content">
|
||||||
<header>
|
<header>
|
||||||
@@ -22,6 +23,7 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
{% if paginator %}{{ paginate_macro::paginate() }}{% endif %}
|
||||||
</main>
|
</main>
|
||||||
{% include "footer.html" %}
|
{% include "footer.html" %}
|
||||||
{% endblock content %}
|
{% endblock content %}
|
||||||
|
|||||||
@@ -18,5 +18,4 @@
|
|||||||
<a href="https://github.com/andwati/andwati.com">Source</a>
|
<a href="https://github.com/andwati/andwati.com">Source</a>
|
||||||
⬡
|
⬡
|
||||||
<a href="/rss.xml">Feed</a>
|
<a href="/rss.xml">Feed</a>
|
||||||
</p>
|
</footer>
|
||||||
</footer>
|
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
{% macro paginate() %}
|
||||||
|
{% if paginator %}
|
||||||
|
<ul class="pagination">
|
||||||
|
{% if paginator.previous %}
|
||||||
|
<li class="page-item page-prev">
|
||||||
|
<a href="{{ paginator.previous }}" class="page-link">← Prev</a>
|
||||||
|
</li>
|
||||||
|
{% else %}
|
||||||
|
<li class="page-item page-prev">
|
||||||
|
<span class="page-link disabled" aria-disabled="true">← Prev</span>
|
||||||
|
</li>
|
||||||
|
{% endif %}
|
||||||
|
<li class="page-item page-numbers">{{ paginator.current_index }} of {{ paginator.number_pagers }}</li>
|
||||||
|
{% if paginator.next %}
|
||||||
|
<li class="page-item page-next">
|
||||||
|
<a href="{{ paginator.next }}" class="page-link">Next →</a>
|
||||||
|
</li>
|
||||||
|
{% else %}
|
||||||
|
<li class="page-item page-next">
|
||||||
|
<span class="page-link disabled" aria-disabled="trues">Next →</span>
|
||||||
|
</li>
|
||||||
|
{% endif %}
|
||||||
|
</ul>
|
||||||
|
{% endif %}
|
||||||
|
{% endmacro paginate %}
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
{%- if page.taxonomies.tags | length > 1 and loop.index != page.taxonomies.tags | length -%},{% endif %}
|
{%- if page.taxonomies.tags | length > 1 and loop.index != page.taxonomies.tags | length -%},{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<div class="accent">☕{{ page.reading_time }} minutes 📝 {{ page.word_count }}</div>
|
<div class="accent">☕ {{ page.reading_time }} minutes 📝 {{ page.word_count }}</div>
|
||||||
</div>
|
</div>
|
||||||
{% endmacro meta %}
|
{% endmacro meta %}
|
||||||
{% macro snippet(page) %}
|
{% macro snippet(page) %}
|
||||||
|
|||||||
@@ -1,15 +1,18 @@
|
|||||||
{% extends "section.html" %}
|
{% extends "section.html" %}
|
||||||
{% import "post_macros.html" as post_macros %}
|
{% import "post_macros.html" as post_macros %}
|
||||||
|
{% import "paginate.html" as paginate_macro %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<main id="content">
|
<main id="content">
|
||||||
<header>
|
<header>
|
||||||
<h1>Posts</h1>
|
<h1>Posts</h1>
|
||||||
</header>
|
</header>
|
||||||
{% for page in paginator.pages %}{{ post_macros::snippet(page=page) }}{% endfor %}
|
{% for page in paginator.pages %}{{ post_macros::snippet(page=page) }}{% endfor %}
|
||||||
<nav>
|
<!--<div class="pagination">
|
||||||
{% if paginator.previous %}<a href="{{ paginator.previous }}" class="previous">Previous</a>{% endif %}
|
{% if paginator.previous %}<a href="{{ paginator.previous }}" class="page-item previous">Previous</a>{% endif %}
|
||||||
{% if paginator.next %}<a href="{{ paginator.next }}" class="next">Next</a>{% endif %}
|
{% if paginator.next %}<a href="{{ paginator.next }}" class="page-item next">Next</a>{% endif %}
|
||||||
</nav>
|
</div>
|
||||||
|
-->
|
||||||
|
{% if paginator %}{{ paginate_macro::paginate() }}{% endif %}
|
||||||
</main>
|
</main>
|
||||||
{% include "footer.html" %}
|
{% include "footer.html" %}
|
||||||
{% endblock content %}
|
{% endblock content %}
|
||||||
|
|||||||
Reference in New Issue
Block a user