on master help sign in
Adding flattened pagination variables and styles
commit1e39d589cb7b56db4f43cfe2d261c45c035c9af7 authorMatilde Park <matilde@tlon.io> dateFri 11 Oct 2019, 23:09 (7 years ago) parentb1abfbb
10 files changed+90−15
content/understanding-urbit/_index.md+3 content/understanding-urbit/network-and-os.md+4 content/understanding-urbit/project-history.md+4 content/understanding-urbit/simple-durable-yours.md+4 content/understanding-urbit/technical-overview.md+4 content/understanding-urbit/urbit-id.md+4 content/understanding-urbit/your-last-computer.md+4 sass/_main.scss+18−2 templates/partials/pagination.html+43−10 templates/understanding-urbit/list.html+2−3
content/understanding-urbit/_index.md+3
@@ -3,4 +3,7 @@ title = "Understanding Urbit"
33sort_by = "weight"
44template = "understanding-urbit/list.html"
55page_template = "understanding-urbit/post.html"
6+[extra]
7+flatten_pagination = "true"
8+hide_next_title = "true"
69+++
content/understanding-urbit/network-and-os.md+4
@@ -2,6 +2,10 @@
22title = "Urbit OS + Network"
33description = "The Urbit OS + Network + how they work together"
44weight = 5
5+[extra]
6+flatten_pagination = "true"
7+hide_next_title = "true"
8+hideprevious = "true"
59+++
610
711
content/understanding-urbit/project-history.md+4
@@ -2,6 +2,10 @@
22title = "Project Status + History"
33description = "Where we've been and were we are now"
44weight = 7
5+[extra]
6+flatten_pagination = "true"
7+hide_next_title = "true"
8+hideprevious = "true"
59+++
610
711Can you move to Urbit today and never look back? Not quite yet. Urbit is still young.
content/understanding-urbit/simple-durable-yours.md+4
@@ -2,6 +2,10 @@
22title = "Simple, Durable, Yours"
33description = "The core ideas that Urbit is built around"
44weight = 1
5+[extra]
6+flatten_pagination = "true"
7+hide_next_title = "true"
8+hideprevious = "true"
59+++
610
711We live in a world dense with computers. We wake up and look at them, we see the world through them, we depend on them completely, and they’re not going away. They’re only becoming more ubiquitous.
content/understanding-urbit/technical-overview.md+4
@@ -2,6 +2,10 @@
22title = "Technical Overview"
33description = "A quick tour of the technology"
44weight = 6
5+[extra]
6+flatten_pagination = "true"
7+hide_next_title = "true"
8+hideprevious = "true"
59+++
610
711
content/understanding-urbit/urbit-id.md+4
@@ -2,6 +2,10 @@
22title = "Urbit ID"
33description = "An overview of the Urbit ID system"
44weight = 4
5+[extra]
6+flatten_pagination = "true"
7+hide_next_title = "true"
8+hideprevious = "true"
59+++
610
711Every time you post a comment, like something, send a message, or use any app or service, you need an account. (And, behind the scenes, a network address.) Neither of these things belongs to you. The way things are going, they never will. No matter what you’re up to with your phone or laptop, you’re dependent on MEGACORP.
content/understanding-urbit/your-last-computer.md+4
@@ -2,6 +2,10 @@
22title = "Your Last Computer"
33description = "What Urbit should feel like to an everyday user"
44weight = 2
5+[extra]
6+flatten_pagination = "true"
7+hide_next_title = "true"
8+hideprevious = "true"
59+++
610
711This whole ‘simple, durable, yours’ thing may sound good, but what does it add up to? What does it feel like?
sass/_main.scss+18−2
@@ -124,7 +124,8 @@ article {
124124}
125125
126126footer nav {
127− &.previous p:first-of-type::after {
127+ // non-flattened pagination
128+ &.previous p:first-of-type:not([data-flat=true])::after {
128129 content: "-->";
129130 font-size: 1.25rem;
130131 position: absolute;
@@ -132,7 +133,7 @@ footer nav {
132133 top: 13px;
133134 font-family: "Inter UI", sans-serif;
134135 }
135− &.next p:first-of-type::before {
136+ &.next p:first-of-type:not([data-flat=true])::before {
136137 content: "<--";
137138 font-size: 1.25rem;
138139 position: absolute;
@@ -140,6 +141,21 @@ footer nav {
140141 top: 13px;
141142 font-family: "Inter UI", sans-serif;
142143 }
144+ // flattened pagination
145+ &.previous p:first-of-type::after {
146+ content: "->";
147+ font-size: 1rem;
148+ position: absolute;
149+ right: -36px;
150+ font-family: "Inter UI", sans-serif;
151+ }
152+ &.next p:first-of-type::before {
153+ content: "<-";
154+ font-size: 1rem;
155+ position: absolute;
156+ left: -36px;
157+ font-family: "Inter UI", sans-serif;
158+ }
143159}
144160
145161// essay template
templates/partials/pagination.html+43−10
@@ -1,18 +1,30 @@
11<footer class="relative mt4">{% if page.earlier %}
22 <a class="bb-0" href="{{page.earlier.permalink}}">
3− <nav class="previous mv5 absolute right-2 f4 t-right">
4− <p class="mb0 f5">Previous Post:</p>
5− <p class="fw6 f5 f4-l f4-xl mb0 mt0">{{page.earlier.title}}</p>
3+ <nav class="previous mv5 absolute right-2 t-right">
4+ {% if page.extra.hide_previous_title %} {% else %}<p class="mb0 f5">Previous Post:</p>{% endif %}
5+ <p {% if page.extra.flatten_pagination %}
6+ data-flat="true"
7+ class="
8+ {% else %}
9+ class="fw6 f5 f4-l f4-xl
10+ {% endif %}
11+ mb0 mt0">{{page.earlier.title}}</p>
612 <time class="mono db f5 mb5">{{page.earlier.date | date(format="~%Y.%-m.%-d") }}</time>
713 </nav>
814 </a>
915
10− {% elif page.heavier %}
16+ {% elif page.heavier and not page.extra.hidenext %}
1117
1218 <a class="bb-0" href="{{page.heavier.permalink}}">
13− <nav class="previous mv5 absolute right-2 f4 t-right">
14− <p class="mb0 f5">Next Post:</p>
15− <p class="fw6 f5 f4-l f4-xl mb0 mt0">{{page.heavier.title}}</p>
19+ <nav class="previous mv5 absolute right-2 t-right">
20+ {% if page.extra.hide_next_title %} {% else %}<p class="mb0 f5">Next Post:</p>{% endif %}
21+ <p {% if page.extra.flatten_pagination %}
22+ data-flat="true"
23+ class="
24+ {% else %}
25+ class="fw6 f5 f4-l f4-xl
26+ {% endif %}
27+ mb0 mt0">{{page.heavier.title}}</p>
1628 </nav>
1729 </a>
1830 {% endif %}
@@ -20,13 +32,34 @@
2032 {% if page.later %}
2133
2234 <a class="bb-0" href="{{page.later.permalink}}">
23− <nav class="next mv5 absolute left-2 f4">
24− <p class="mb0 f5">Next Post:</p>
25− <p class="fw6 f5 f4-l f4-xl mb0 mt0">{{page.later.title}}</p>
35+ <nav class="next mv5 absolute left-2">
36+ {% if page.extra.hide_next_title %} {% else %}<p class="mb0 f5">Next Post:</p>{% endif %}
37+ <p {% if page.extra.flatten_pagination %}
38+ data-flat="true"
39+ class="
40+ {% else %}
41+ class="fw6 f5 f4-l f4-xl
42+ {% endif %}
43+ mb0 mt0">{{page.later.title}}</p>
2644 <time class="mono db f5 mb5">{{page.later.date | date(format="~%Y.%-m.%-d") }}</time>
2745 </nav>
2846 </a>
2947
48+
49+ {% elif page.lighter and not page.extra.hideprevious %}
50+
51+ <a class="bb-0" href="{{page.lighter.permalink}}">
52+ <nav class="next mv5 absolute left-2">
53+ {% if page.extra.hide_previous_title %} {% else %}<p class="mb0 f5">Previous Post:</p>{% endif %}
54+ <p {% if page.extra.flatten_pagination %}
55+ data-flat="true"
56+ class="
57+ {% else %}
58+ class="fw6 f5 f4-l f4-xl
59+ {% endif %}
60+ mb0 mt0">{{page.lighter.title}}</p>
61+ </nav>
62+ </a>
3063 {% endif %}
3164
3265</footer>
templates/understanding-urbit/list.html+2−3
@@ -46,9 +46,8 @@
4646 {% set posts = get_section(path="understanding-urbit/_index.md") %}
4747 {% for directorypage in posts.pages | slice (end=1) %}
4848 <a class="bb-0" href="{{directorypage.permalink}}">
49− <nav class="previous mv5 absolute right-2 f4 t-right">
50− <p class="mb0 f5">Next Post:</p>
51− <p class="fw6 f5 f4-l f4-xl mb0 mt0">{{directorypage.title}}</p>
49+ <nav class="previous mv5 absolute right-2 t-right">
50+ <p data-flat="true" class="mb0 mt0">{{directorypage.title}}</p>
5251 </nav>
5352 </a>
5453 {% endfor %}