From a76785145fa48806d361d9a90bf287b1a7e8a247 Mon Sep 17 00:00:00 2001 From: Damien Caselli Date: Tue, 9 Aug 2016 15:57:29 +0200 Subject: Initial commit --- LICENSE.md | 20 +++++ README.md | 33 ++++++++ archetypes/default.md | 2 + layouts/404.html | 1 + layouts/index.html | 27 +++++++ layouts/partials/footer.html | 5 ++ layouts/partials/head.html | 14 ++++ layouts/partials/header.html | 11 +++ layouts/partials/nav.html | 17 ++++ layouts/partials/title.html | 7 ++ layouts/post/list-item-expanded.html | 12 +++ layouts/post/list-item.html | 3 + layouts/post/single.html | 21 +++++ layouts/section/post.html | 35 ++++++++ static/css/paperback.css | 149 +++++++++++++++++++++++++++++++++++ theme.toml | 12 +++ 16 files changed, 369 insertions(+) create mode 100644 LICENSE.md create mode 100644 README.md create mode 100644 archetypes/default.md create mode 100644 layouts/404.html create mode 100644 layouts/index.html create mode 100644 layouts/partials/footer.html create mode 100644 layouts/partials/head.html create mode 100644 layouts/partials/header.html create mode 100644 layouts/partials/nav.html create mode 100644 layouts/partials/title.html create mode 100644 layouts/post/list-item-expanded.html create mode 100644 layouts/post/list-item.html create mode 100644 layouts/post/single.html create mode 100644 layouts/section/post.html create mode 100644 static/css/paperback.css create mode 100644 theme.toml diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..d704420 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2016 Damien Caselli + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..9b6c089 --- /dev/null +++ b/README.md @@ -0,0 +1,33 @@ +# Paperback + +_Paperback_ is a minimalist theme for [Hugo](http://gohugo.io). + +It focuses on reading experience, and was mostly designed to suit my needs. + +## Parameters + +A few parameters can be adjusted in the site config: + +```toml +[params] + +# default: undefined +AuthorName = "Firstname Lastname" + +# tagline to show beneath homepage h1 +# default: undefined +Tagline = "Hello, world!" + +# number of posts to show on index; default: 10 +HomepagePosts = 3 + +# if set to true, social links will be displayed in the footer +# default: undefined +SocialLinks = true + +# default: undefined +GithubUsername = "damiencaselli" + +# default: undefined +TwitterUsername = "damiencaselli" +``` diff --git a/archetypes/default.md b/archetypes/default.md new file mode 100644 index 0000000..ac36e06 --- /dev/null +++ b/archetypes/default.md @@ -0,0 +1,2 @@ ++++ ++++ diff --git a/layouts/404.html b/layouts/404.html new file mode 100644 index 0000000..af97393 --- /dev/null +++ b/layouts/404.html @@ -0,0 +1 @@ +four oh four diff --git a/layouts/index.html b/layouts/index.html new file mode 100644 index 0000000..bdf9156 --- /dev/null +++ b/layouts/index.html @@ -0,0 +1,27 @@ + + + + {{ partial "head.html" . }} + + +
+ + {{ partial "header.html" . }} + +
+ + {{ range first (index .Site.Params "HomepagePosts" | default 3) (where .Data.Pages "Type" "post") }} +
+ {{ .Render "list-item-expanded" }} +
+ {{ end }} + +
+ + {{ partial "nav.html" . }} + + {{ partial "footer.html" . }} + +
+ + diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html new file mode 100644 index 0000000..6371e16 --- /dev/null +++ b/layouts/partials/footer.html @@ -0,0 +1,5 @@ + diff --git a/layouts/partials/head.html b/layouts/partials/head.html new file mode 100644 index 0000000..e94efaa --- /dev/null +++ b/layouts/partials/head.html @@ -0,0 +1,14 @@ + + + + + + + {{ .Hugo.Generator }} + {{ partial "title" . }} + + + + + + diff --git a/layouts/partials/header.html b/layouts/partials/header.html new file mode 100644 index 0000000..64fe71b --- /dev/null +++ b/layouts/partials/header.html @@ -0,0 +1,11 @@ +
+

{{ .Title }}

+ + {{ if ne .IsNode true }} + + {{ end }} + + {{ if and .IsHome (isset .Site.Params "Tagline") }} +

{{ .Site.Params.Tagline }}

+ {{ end }} +
diff --git a/layouts/partials/nav.html b/layouts/partials/nav.html new file mode 100644 index 0000000..58e57a1 --- /dev/null +++ b/layouts/partials/nav.html @@ -0,0 +1,17 @@ + diff --git a/layouts/partials/title.html b/layouts/partials/title.html new file mode 100644 index 0000000..1c260c6 --- /dev/null +++ b/layouts/partials/title.html @@ -0,0 +1,7 @@ + + {{- if eq .IsHome true -}} + {{ .Site.Title }} + {{- else -}} + {{ .Title }} — {{ .Site.Title }} + {{- end -}} + diff --git a/layouts/post/list-item-expanded.html b/layouts/post/list-item-expanded.html new file mode 100644 index 0000000..c623be8 --- /dev/null +++ b/layouts/post/list-item-expanded.html @@ -0,0 +1,12 @@ +

{{ .Title }}

+
+ {{ if .Truncated }} + {{ .Summary }} + + + {{ else }} + {{ .Content }} + {{ end }} +
diff --git a/layouts/post/list-item.html b/layouts/post/list-item.html new file mode 100644 index 0000000..c909b3a --- /dev/null +++ b/layouts/post/list-item.html @@ -0,0 +1,3 @@ +

+ {{ .Title }} +

diff --git a/layouts/post/single.html b/layouts/post/single.html new file mode 100644 index 0000000..18f9fbf --- /dev/null +++ b/layouts/post/single.html @@ -0,0 +1,21 @@ + + + + {{ partial "head.html" . }} + + +
+ + {{ partial "header.html" . }} + +
+ {{ .Content }} +
+ + {{ partial "nav.html" . }} + + {{ partial "footer.html" . }} + +
+ + diff --git a/layouts/section/post.html b/layouts/section/post.html new file mode 100644 index 0000000..7f452e7 --- /dev/null +++ b/layouts/section/post.html @@ -0,0 +1,35 @@ + + + + {{ partial "head.html" . }} + + +
+ + {{ partial "header.html" . }} + +
+ + {{ range (where .Data.Pages "Type" "post").GroupByDate "2006/01" -}} +
+

{{ .Key }}

+ +
    + {{ range .Pages -}} +
  1. + {{ .Render "list-item" }} +
  2. + {{ end }} +
+
+ {{ end }} + +
+ + {{ partial "nav.html" . }} + + {{ partial "footer.html" . }} + +
+ + diff --git a/static/css/paperback.css b/static/css/paperback.css new file mode 100644 index 0000000..6a48e69 --- /dev/null +++ b/static/css/paperback.css @@ -0,0 +1,149 @@ +*, *:before, *:after { + box-sizing: border-box; +} + +html { + font-family: Arvo, Philosopher, serif; + color: #303030; + background-color: #f5f5f0; + font-size: 1rem; +} + +body { + line-height: 1.6; +} + +hr { + margin: 2rem 0; + height: 0; + display: block; + width: 100%; + border: 0; + border-top: 1px solid #888888; +} + +img { + max-width: 100%; +} + +blockquote { + margin: 0 0 1rem; + padding: 1rem 1rem 0; + color: #888888; + border-left: 1px solid currentColor; +} + +blockquote cite { + display: block; + margin-top: 1rem; + font-style: italic; + font-size: .875rem; +} + +blockquote cite:before { + content: "— " +} + +a { + color: currentColor; + text-decoration: none; + border-bottom: 1px solid currentColor; +} + a:hover { + text-decoration: none; + border-bottom: 0; + } + +ol, ul { + margin: 0 0 1rem 1.25rem; + padding: 0; + list-style-position: outside; +} + +ol ol, ul ul, ul ol, ol ul { + margin-bottom: 0; +} + +li { + margin: 0; +} + +kbd, code, pre { + font-family: "Source Code Pro", monospace; +} + +kbd { + padding: .125rem .25rem 0; + margin: 0; + background-color: #ececec; +} + +article, section { + margin-bottom: 1rem; +} + +h1 { + margin: 0 0 1rem; + font-size: 1.875rem; +} + +h2, h3, h4, h5, h6 { + margin: 0 0 .5rem; +} + +h2 { + font-size: 2rem; +} + +h3 { + font-size: 1.75rem; +} + +h4 { + font-size: 1.5rem; +} + +h5 { + font-size: 1.25rem; +} + +h6 { + font-size: 1rem; +} + +p { + margin: 0 0 1rem; +} + +time { + display: block; + margin: 0 0 1rem; +} + +footer, .site-nav { + margin: 0 0 .5rem; + font-size: 14px; + color: #888888; +} + + footer a, .site-nav a { + color: currentColor; + } + + footer > *+*, .site-nav > *+* { + margin-left: .5rem; + } + +.container { + max-width: 34rem; + width: 100%; + margin: 0 auto; +} + +.site-nav { + margin-top: 2rem; +} + +.site-footer { + margin-bottom: 1rem; +} diff --git a/theme.toml b/theme.toml new file mode 100644 index 0000000..51af7c3 --- /dev/null +++ b/theme.toml @@ -0,0 +1,12 @@ +name = "Paperback" +license = "MIT" +licenselink = "https://github.com/damiencaselli/paperback/blob/master/LICENSE.md" +description = "Minimalist theme for Hugo." +homepage = "https://github.com/damiencaselli/paperback" +tags = ["minimalist", "reading", "sepia"] +features = ["blog"] +min_version = 0.15 + +[author] +name = "Damien Caselli" +homepage = "http://dcsl.li" -- cgit v1.2.3