Improve post navigation
This commit is contained in:
parent
e9e604cef5
commit
d76eb85f1d
|
@ -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;
|
||||
|
|
|
@ -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 }}
|
Reference in New Issue