on master help sign in
Pagination
commit03af916b96f0f164d9ac58b7eba48305b4e53100 authorMatilde Park <matilde@tlon.io> dateThu 5 Sep 2019, 22:02 (7 years ago) parentb5ac5c8
4 files changed+66−20
sass/_main.scss+18−5 templates/essays/list.html+2−6 templates/essays/post.html+19 templates/page.html+27−9
sass/_main.scss+18−5
@@ -79,7 +79,24 @@ article {
7979 }
8080 // post directories
8181 li {
82− margin: 1rem;
82+ margin: 0rem 1rem 1rem 1rem;
83+ }
84+}
85+
86+footer nav {
87+ &.previous p:first-of-type::after {
88+ content: "-->";
89+ font-size: 1.25rem;
90+ position: absolute;
91+ right: -36px;
92+ top: 13px;
93+ }
94+ &.next p:first-of-type::before {
95+ content: "<--";
96+ font-size: 1.25rem;
97+ position: absolute;
98+ left: -36px;
99+ top: 13px;
83100 }
84101}
85102
@@ -152,10 +169,6 @@ ul.posts, nav ul {
152169 list-style-type: none;
153170}
154171
155−ul.posts li {
156− margin: 2rem 0 2rem 0;
157−}
158−
159172nav ul.docs {
160173 line-height: 30px;
161174}
templates/essays/list.html+2−6
@@ -11,19 +11,15 @@
1111 {% include "partials/navigation-search.html" %}
1212</nav>
1313<!-- content -->
14− <article class="mt6 mb6 full c4-12-lg">
15− <h1 class="mb8">Essays</h1>
14+ <article class="mt6-lg mb6 full c4-12-lg">
1615 <ul class="posts">
1716 {% set posts = get_section(path="essays/_index.md") %}
1817 {% for page in posts.pages %}
19− <li class="mb6 mt6">
18+ <li class="mb8">
2019 <h2 class="mb1"><a class="bb0" href="{{ page.permalink }}">{{ page.title }}</a></h2>
2120 <p class="mb2 mt2">{{ page.description }}</p>
2221 <time class="mono f5">{{ page.date | date(format="~%Y.%-m.%-d") }}</time>
2322 <span class="mono f5">
24− <a class="mono f5 ml2" href="/essays">
25− essays
26− </a>
2723 {% if page.extra.ship %}<address class="mono f5 ml2">{{ page.extra.ship }}</address> {% endif %}
2824 </span>
2925 </li>
templates/essays/post.html+19
@@ -37,5 +37,24 @@
3737 {% endif %}
3838 <!-- body -->
3939 {{ page.content | safe }}
40+
41+ <footer class="relative">{% if page.earlier %}
42+ <a class="bb0" href="{{page.earlier.permalink}}">
43+ <nav class="previous mv6 absolute right4 f4 t-right">
44+ <p class="mb0 f5">Previous Post:</p>
45+ <p class="fw-bold f4 mb0 mt0">{{page.earlier.title}}</p>
46+ <time class="mono block f5">{{page.earlier.date | date(format="~%Y.%-m.%-d") }}</time>
47+ </nav>
48+ </a>
49+ {% endif %}
50+
51+ {% if page.later %}
52+ <nav class="next mv6 absolute left4 f4">
53+ <p class="mb0">Next Post:</p>
54+ <a class="fw-bold bb0" href="{{page.later.permalink}}">{{page.later.title}}</a>
55+ <time class="mono block f5">{{page.later.date | date(format="~%Y.%-m.%-d") }}</time>
56+ </nav>
57+ {% endif %}
58+ </footer>
4059 </article>
4160{% endblock content %}
templates/page.html+27−9
@@ -22,16 +22,34 @@
2222{% endif %}
2323 <article class="mt6 mb6 full-ns c4-10-lg">
2424 <h1>{{ page.title }}</h1>
25− <!-- body -->
26− {{ page.content | safe }}
2725 {% if page.extra.author %}
28− <span class="mt3" rel="author"> {{ page.extra.author }} </span>
29− {% if page.extra.ship %}
30− <address class="mono">{{ page.extra.ship }}</address>
31− {% endif %}
32− {% if page.date %}
33− <time class="mono block f5">~{{page.date | date(format="~%Y.%-m.%-d") }}</time>
34− {% endif %}
26+ <span class="mt2 inline-block" rel="author"> {{ page.extra.author }} </span>
27+ {% if page.extra.ship %}
28+ <address class="mono">{{ page.extra.ship }}</address>
29+ {% endif %}
30+ {% if page.date %}
31+ <time class="mono block mv1 gray4 f5">{{page.date | date(format="~%Y.%-m.%-d") }}</time>
3532 {% endif %}
33+ {% endif %}
34+ <!-- body -->
35+ {{ page.content | safe }}
36+ <footer class="relative">{% if page.earlier %}
37+ <a class="bb0" href="{{page.earlier.permalink}}">
38+ <nav class="previous mv6 absolute right4 f4 t-right">
39+ <p class="mb0 f5">Previous Post:</p>
40+ <p class="fw-bold f4 mb0 mt0">{{page.earlier.title}}</p>
41+ <time class="mono block f5">{{page.earlier.date | date(format="~%Y.%-m.%-d") }}</time>
42+ </nav>
43+ </a>
44+ {% endif %}
45+
46+ {% if page.later %}
47+ <nav class="next mv6 absolute left4 f4">
48+ <p class="mb0">Next Post:</p>
49+ <a class="fw-bold bb0" href="{{page.later.permalink}}">{{page.later.title}}</a>
50+ <time class="mono block f5">{{page.later.date | date(format="~%Y.%-m.%-d") }}</time>
51+ </nav>
52+ {% endif %}
53+ </footer>
3654 </article>
3755{% endblock content %}