Add see also section to posts footer (#152)
* Fix series list page title * Add see also section to posts footer
This commit is contained in:
parent
da6f9e1389
commit
27e83b1e5a
|
@ -19,6 +19,12 @@
|
|||
}
|
||||
footer {
|
||||
margin-top: 4.0rem;
|
||||
.see-also {
|
||||
margin: 3.2rem 0;
|
||||
h3 {
|
||||
margin: 3.2rem 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.post {
|
||||
|
|
|
@ -36,6 +36,9 @@ disqusShortname = "yourdiscussshortname"
|
|||
# Use inverted colors
|
||||
inverted = false
|
||||
|
||||
# Series see also post count
|
||||
maxSeeAlsoItems = 5
|
||||
|
||||
# Custom CSS
|
||||
custom_css = []
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ title = "Creating a New Theme"
|
|||
slug = "creating-a-new-theme"
|
||||
tags = []
|
||||
categories = []
|
||||
series = ["Theme", "Hugo"]
|
||||
+++
|
||||
|
||||
## Introduction
|
||||
|
|
|
@ -11,4 +11,5 @@ categories = [
|
|||
"Development",
|
||||
]
|
||||
externalLink = "https://github.com/luizdepra/hugo-coder/wiki"
|
||||
series = ["Hugo"]
|
||||
+++
|
||||
|
|
|
@ -13,7 +13,7 @@ categories = [
|
|||
"Development",
|
||||
"golang",
|
||||
]
|
||||
series = ["Getting Started"]
|
||||
series = ["Getting Started", "Hugo"]
|
||||
+++
|
||||
|
||||
Hugo uses the excellent [go][] [html/template][gohtmltemplate] library for
|
||||
|
|
|
@ -11,7 +11,7 @@ categories = [
|
|||
"Development",
|
||||
"golang",
|
||||
]
|
||||
series = ["Getting Started"]
|
||||
series = ["Getting Started", "Hugo"]
|
||||
+++
|
||||
|
||||
## Step 1. Install Hugo
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
date = "2014-03-10"
|
||||
title = "Migrate to Hugo from Jekyll"
|
||||
description = "The post explains how to migrate from from Jekyll to Hugo."
|
||||
series = ["Getting Started"]
|
||||
series = ["Getting Started", "Hugo"]
|
||||
+++
|
||||
|
||||
Table of Contents
|
||||
|
|
|
@ -4,7 +4,7 @@ title = "Theme Demo"
|
|||
description = "The post demonstrates features of the coder theme."
|
||||
images = ["/images/N90.jpg"]
|
||||
math = "true"
|
||||
|
||||
series = ["Theme", "Hugo"]
|
||||
+++
|
||||
|
||||
## Style Demo
|
||||
|
|
|
@ -4,6 +4,9 @@ other = "category"
|
|||
[tag]
|
||||
other = "tag"
|
||||
|
||||
[series]
|
||||
other = "series"
|
||||
|
||||
[reading_time]
|
||||
one = "One minute read"
|
||||
other = "{{ .Count }} minutes read"
|
||||
|
|
|
@ -4,6 +4,9 @@ other = "categoria"
|
|||
[tag]
|
||||
other = "tag"
|
||||
|
||||
[series]
|
||||
other = "séries"
|
||||
|
||||
[reading_time]
|
||||
one = "Um minuto de leitura"
|
||||
other = "{{ .Count }} minutos de leitura"
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
{{ $currentPageUrl := .URL }}
|
||||
{{ if .Params.series }}
|
||||
<section class="see-also">
|
||||
{{ range .Params.series }}
|
||||
<h3>See also in {{ . }}</h3>
|
||||
{{ $name := . | urlize }}
|
||||
{{ $series := index $.Site.Taxonomies.series $name }}
|
||||
{{ if gt (len $series.Pages) 0 }}
|
||||
<nav>
|
||||
<ul>
|
||||
{{ $maxItems := $.Site.Params.maxSeeAlsoItems | default 5 }}
|
||||
{{ range first (add $maxItems 1) $series.Pages }}
|
||||
{{ if ne .URL $currentPageUrl }}
|
||||
<li>
|
||||
<a href="{{ .Params.ExternalLink | default .URL }}">{{ .Title }}</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</ul>
|
||||
</nav>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</section>
|
||||
{{ end }}
|
|
@ -31,6 +31,7 @@
|
|||
</div>
|
||||
|
||||
<footer>
|
||||
{{ partial "posts/series" . }}
|
||||
{{ partial "posts/disqus" . }}
|
||||
</footer>
|
||||
</article>
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1 +1 @@
|
|||
{"Target":"css/coder.min.8881182b3ec36ffd9c735306f7e16ce9b1129ebc650e069e7c4114827e9d9b23.css","MediaType":"text/css","Data":{"Integrity":"sha256-iIEYKz7Db/2cc1MG9+Fs6bESnrxlDgaefEEUgn6dmyM="}}
|
||||
{"Target":"css/coder.min.28d751104f30c16da1aa1bb04015cbe662cacfe0d1b01af4f2240ad58580069c.css","MediaType":"text/css","Data":{"Integrity":"sha256-KNdREE8wwW2hqhuwQBXL5mLKz+DRsBr08iQK1YWABpw="}}
|
Loading…
Reference in New Issue