jlelse
/
Indieroad
Archived
1
Fork 0

Improve post navigation

This commit is contained in:
Jan-Lukas Else 2020-02-02 11:11:07 +01:00
parent e9e604cef5
commit d76eb85f1d
2 changed files with 22 additions and 27 deletions

View File

@ -727,25 +727,20 @@ select {
} }
.item { .item {
flex: 1 1 50%; flex: 1 1 50%;
max-width: 48%; max-width: 100%;
text-align: center;
@media screen and (max-width: $break1) { @media screen and (max-width: $break1) {
max-width: 100%; &:last-of-type:not(:first-of-type) {
} padding-top: 10px;
&--prev {
margin-right: auto;
text-align: left;
@media screen and (max-width: $break1) {
padding-bottom: 10px;
min-width: 100%;
text-align: center;
} }
} }
&--next { @media screen and (min-width: $break1) {
margin-left: auto; max-width: 48%;
text-align: right; &--prev {
@media screen and (max-width: $break1) { text-align: left;
min-width: 100%; }
text-align: center; &--next {
text-align: right;
} }
} }
.link { .link {
@ -754,10 +749,10 @@ select {
margin-bottom: 0; margin-bottom: 0;
overflow: hidden; overflow: hidden;
font-size: .8125rem; font-size: .8125rem;
margin-top: 5px;
} }
.caption { .caption {
display: block; display: block;
margin-bottom: 5px;
font-weight: 700; font-weight: 700;
line-height: 1; line-height: 1;
text-transform: uppercase; text-transform: uppercase;

View File

@ -1,17 +1,17 @@
{{- if .Param "post_navigation" }} {{ if .Param "post_navigation" }}
{{- if or (.PrevInSection) (.NextInSection) }} {{ if or (.PrevInSection) (.NextInSection) }}
<nav class="post-nav"> <nav class="post-nav">
{{- if .PrevInSection }} {{ if .PrevInSection }}
<div class="item item--prev"> <div class="item item--prev">
<a class="link" href="{{.PrevInSection.RelPermalink}}" rel="prev"><span class="caption">{{ T "post_nav_prev" }}</span><p class="post-title">{{.PrevInSection.Title}}</p></a> <a class="link" href="{{.PrevInSection.RelPermalink}}" rel="prev"><span class="caption">{{ T "post_nav_prev" }}</span>{{ with .PrevInSection.Title }}<p class="post-title">{{ . }}</p>{{ end }}</a>
</div> </div>
{{- end }} {{ end }}
{{- if .NextInSection }} {{ if .NextInSection }}
<div class="item item--next"> <div class="item item--next">
<a class="link" href="{{.NextInSection.RelPermalink}}" rel="next"><span class="caption">{{ T "post_nav_next" }}</span><p class="post-title">{{.NextInSection.Title}}</p></a> <a class="link" href="{{.NextInSection.RelPermalink}}" rel="next"><span class="caption">{{ T "post_nav_next" }}</span>{{ with .NextInSection.Title }}<p class="post-title">{{ . }}</p>{{ end }}</a>
</div> </div>
{{- end }} {{ end }}
</nav> </nav>
{{- end }} {{ end }}
{{ partial "related.html" . }} {{ partial "related.html" . }}
{{- end }} {{ end }}