Skip to content

Commit

Permalink
Update adding next prev link in docs section. #8
Browse files Browse the repository at this point in the history
  • Loading branch information
mitsut committed Jul 11, 2020
1 parent 84140ca commit a9ce44c
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 1 deletion.
3 changes: 2 additions & 1 deletion layouts/docs/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ <h1> {{ .Title}} </h1>
{{ partial "toc" .}}

{{ .Content}}
{{ partial "prev-next" . }}
<!-- Inject script tag in this template -->
{{if .Params.script}}
{{ $script := (delimit (slice "scripts" .Params.script) "/")}}
{{ partial (string $script) .}}
{{end }}
</div>
</div>
</div>
{{ end }}
{{ define "footer"}} {{ partial "footer" .}} {{end}}
12 changes: 12 additions & 0 deletions layouts/partials/prev-next.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<div class="xPrevNextLink">
{{ with .NextInSection }}
<div class="xPrevNextLink_prev">
<a href="{{ .Permalink }}">{{ .LinkTitle }}</a>
</div>
{{ end }}
{{ with .PrevInSection }}
<div class="xPrevNextLink_next">
<a href="{{ .Permalink }}">{{ .LinkTitle }}</a>
</div>
{{ end }}
</div>
24 changes: 24 additions & 0 deletions static/css/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/* 前ページ、次ページへのリンク */
.xPrevNextLink::after {
/* float による回り込みの解除 */
display: block;
content: "";
clear: both;
}
.xPrevNextLink_prev {
display: block;
float: left;
}
.xPrevNextLink_prev::before {
content: "≪";
}
.xPrevNextLink_next {
display: block;
float: right;
text-align: right;

}
.xPrevNextLink_next::after {
content: "≫";
}

0 comments on commit a9ce44c

Please sign in to comment.