File tree Expand file tree Collapse file tree 3 files changed +163
-2
lines changed
Expand file tree Collapse file tree 3 files changed +163
-2
lines changed Original file line number Diff line number Diff line change 22 "extends" : [
33 " stylelint-config-standard-scss" ,
44 " stylelint-config-recess-order"
5- ]
5+ ],
6+ "rules" : {
7+ "no-descending-specificity" : null
8+ }
69}
Original file line number Diff line number Diff line change 1+ @mixin respond-to ($media ) {
2+ @if $media == handhelds {
3+ @include media-breakpoint-down (sm) {
4+ @content ;
5+ }
6+ } @else if $media == medium- screens {
7+ @include media-breakpoint-up (sm) {
8+ @content ;
9+ }
10+ } @else if $media == wide- screens {
11+ @include media-breakpoint-up (lg) {
12+ @content ;
13+ }
14+ }
15+ }
16+
117.news-item {
218 .post-content {
319 padding-top : 3rem ;
420 }
21+
22+ .single-post-pager {
23+ display : flex ;
24+ flex-direction : row ;
25+ align-items : stretch ;
26+ width : 100% ;
27+ border-top : 2px solid $tertiary ;
28+ border-bottom : 2px solid $tertiary ;
29+
30+ @include respond-to (handhelds) {
31+ display : block ;
32+ }
33+ }
34+
35+ .post-title {
36+ font-weight : normal ;
37+ }
38+
39+ .pager-link {
40+ position : relative ;
41+ display : flex ;
42+ flex : 1 ;
43+ align-items : center ;
44+ padding-top : 2rem ;
45+ padding-bottom : 2rem ;
46+ color : inherit ;
47+ text-decoration : none ;
48+
49+ .pager-direction ,
50+ .pager-date ,
51+ .pager-chevron {
52+ position : absolute ;
53+ color : $primary ;
54+ }
55+
56+ .pager-date {
57+ bottom : 0.5rem ;
58+ font-size : 0.75em ;
59+ }
60+
61+ .pager-direction {
62+ top : 0.5rem ;
63+ font-weight : bold ;
64+ }
65+
66+ .pager-chevron {
67+ top : 50% ;
68+ height : 4rem ;
69+ margin-top : -2rem ;
70+ font-size : 4rem ;
71+ line-height : 4rem ;
72+ transition : all 0.2s ease ;
73+ }
74+
75+ .pager-title {
76+ line-height : 1.25rem ;
77+ }
78+
79+ & :hover {
80+ background : shade-color ($body-bg , 10% );
81+
82+ .pager-title {
83+ color : $primary ;
84+ }
85+ }
86+
87+ @include respond-to (handhelds) {
88+ display : block ;
89+ width : 100% ;
90+ }
91+ }
92+
93+ .newer-post {
94+ padding-right : 1rem ;
95+ padding-left : 4rem ;
96+ text-align : left ;
97+
98+ @include respond-to (handhelds) {
99+ border-bottom : 1px solid tint-color ($tertiary , 10% );
100+ }
101+
102+ .pager-chevron {
103+ left : 1.5rem ;
104+ }
105+
106+ & :hover .pager-chevron {
107+ left : 1rem ;
108+ }
109+
110+ .pager-date {
111+ left : 4rem ;
112+ }
113+ }
114+
115+ .older-post {
116+ justify-content : flex-end ;
117+ padding-right : 4rem ;
118+ padding-left : 1rem ;
119+ text-align : right ;
120+
121+ .pager-chevron {
122+ right : 1.5rem ;
123+ }
124+
125+ & :hover .pager-chevron {
126+ right : 1rem ;
127+ }
128+
129+ .pager-date {
130+ right : 4rem ;
131+ }
132+
133+ .pager-direction {
134+ right : 4rem ;
135+ }
136+ }
5137}
Original file line number Diff line number Diff line change 11---
22layout: default
33permalink: "/news/{{ page .date | date: '%Y/%m/%d' }}/{{ page .fileSlug }}/"
4+ body_classes:
5+ - news-item
46---
57{%- assign author = authors [author] -%}
68<main class =' flex-shrink-0' >
79 <div class =' container' >
8- <article itemscope itemtype =' http://schema.org/Article' >
10+ <article class = ' pb-4 ' itemscope itemtype =' http://schema.org/Article' >
911 <h1 class =' post-title mt-5 mb-4' itemprop =' headline' >
1012 {{- title -}}
1113 </h1 >
@@ -43,5 +45,29 @@ permalink: "/news/{{ page.date | date: '%Y/%m/%d' }}/{{ page.fileSlug }}/"
4345 {{ content }}
4446 </div >
4547 </article >
48+ {%- assign prev_post = collections .posts | getPreviousCollectionItem -%}
49+ {%- assign next_post = collections .posts | getNextCollectionItem -%}
50+ <nav class =' single-post-pager' >
51+ {% if prev_post %}
52+ <a class =' pager-link newer-post' href =' {{ prev_post .url }}' >
53+ <span class =' pager-direction' >Newer</span >
54+ <span class =' pager-title' >{{- prev_post .data .title -}}</span >
55+ <span class =' pager-date' >
56+ {{- prev_post .date | date_to_string -}}
57+ </span >
58+ <span class =' pager-chevron' >‹ ; </span >
59+ </a >
60+ {% endif %}
61+ {% if next_post %}
62+ <a class =' pager-link older-post' href =' {{ next_post .url }} ' >
63+ <span class =' pager-direction' >Older</span >
64+ <span class =' pager-title' >{{- next_post .data .title -}}</span >
65+ <span class =' pager-date' >
66+ {{- next_post .date | date_to_string -}}
67+ </span >
68+ <span class =' pager-chevron' >› ; </span >
69+ </a >
70+ {% endif %}
71+ </nav >
4672 </div >
4773</main >
You can’t perform that action at this time.
0 commit comments