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

View File

@ -1,17 +1,17 @@
{{- if .Param "post_navigation" }}
{{- if or (.PrevInSection) (.NextInSection) }}
{{ if .Param "post_navigation" }}
{{ if or (.PrevInSection) (.NextInSection) }}
<nav class="post-nav">
{{- if .PrevInSection }}
{{ if .PrevInSection }}
<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>
{{- end }}
{{- if .NextInSection }}
{{ end }}
{{ if .NextInSection }}
<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>
{{- end }}
{{ end }}
</nav>
{{- end }}
{{ end }}
{{ partial "related.html" . }}
{{- end }}
{{ end }}