From 0b4c2b530729b1d29bad0252ceb9ea53d1f7a33d Mon Sep 17 00:00:00 2001 From: Alexis Tacnet Date: Sat, 8 Apr 2017 19:23:50 +0200 Subject: [PATCH] Add a navigation a the bottom of posts --- exampleSite/config.toml | 1 + layouts/blog/single.html | 18 ++++++++++++- static/css/main.v0.9.1.css | 53 ++++++++++++++++++++++++++++++++++++++ static/img/back.svg | 39 ++++++++++++++++++++++++++++ static/img/next.svg | 40 ++++++++++++++++++++++++++++ 5 files changed, 150 insertions(+), 1 deletion(-) create mode 100644 static/img/back.svg create mode 100644 static/img/next.svg diff --git a/exampleSite/config.toml b/exampleSite/config.toml index a0ffed0..baac946 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -29,3 +29,4 @@ email = "you@example.com" linkedin = "john-example-aa80ue8รจ" twitter = "example" social_banner = "img/banner.png" +posts_navigation = true \ No newline at end of file diff --git a/layouts/blog/single.html b/layouts/blog/single.html index c2c063b..2d1cd6f 100644 --- a/layouts/blog/single.html +++ b/layouts/blog/single.html @@ -28,8 +28,24 @@
{{ partial "content" . }}
-

Back to posts

+ {{ if .Site.Params.posts_navigation }} + + {{ end }}
{{ template "_internal/disqus.html" . }} diff --git a/static/css/main.v0.9.1.css b/static/css/main.v0.9.1.css index 47dae44..e61489c 100644 --- a/static/css/main.v0.9.1.css +++ b/static/css/main.v0.9.1.css @@ -774,3 +774,56 @@ section.main .content .markdown .footnotes li { section.main .content .markdown .footnote-ref { font-size: 0.7em; } +section.main .content .navigation { + display: -webkit-flex; + display: -moz-flex; + display: -ms-flexbox; + display: -ms-flex; + display: flex; + -webkit-flex-direction: column; + -moz-flex-direction: column; + -ms-flex-direction: column; + flex-direction: column; + -webkit-align-items: center; + -moz-align-items: center; + -ms-align-items: center; + align-items: center; +} +section.main .content .navigation div { + display: -webkit-flex; + display: -moz-flex; + display: -ms-flexbox; + display: -ms-flex; + display: flex; + -webkit-flex-direction: row; + -moz-flex-direction: row; + -ms-flex-direction: row; + flex-direction: row; + -webkit-align-items: center; + -moz-align-items: center; + -ms-align-items: center; + align-items: center; + margin-top: 1em; +} +section.main .content .navigation .icon { + width: 16px; + height: 16px; +} +section.main .content .navigation a { + width: 250px; + margin-left: 1em; + text-align: center; + font-style: italic; + color: #313537; +} +@media (min-width: 570px) { + section.main .content .navigation { + -webkit-flex-direction: row; + -moz-flex-direction: row; + -ms-flex-direction: row; + flex-direction: row; + } + section.main .content .navigation div { + margin-top: 0em; + } +} \ No newline at end of file diff --git a/static/img/back.svg b/static/img/back.svg new file mode 100644 index 0000000..4d26923 --- /dev/null +++ b/static/img/back.svg @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/static/img/next.svg b/static/img/next.svg new file mode 100644 index 0000000..3829cf2 --- /dev/null +++ b/static/img/next.svg @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +