Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/damiencaselli/paperback.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Caselli <damien.caselli@gmail.com>2016-08-09 16:57:29 +0300
committerDamien Caselli <damien.caselli@gmail.com>2016-08-09 16:57:29 +0300
commita76785145fa48806d361d9a90bf287b1a7e8a247 (patch)
treef61f6a3b803e53e4eadd01995dc2a4d6d9946c1c
Initial commit
-rw-r--r--LICENSE.md20
-rw-r--r--README.md33
-rw-r--r--archetypes/default.md2
-rw-r--r--layouts/404.html1
-rw-r--r--layouts/index.html27
-rw-r--r--layouts/partials/footer.html5
-rw-r--r--layouts/partials/head.html14
-rw-r--r--layouts/partials/header.html11
-rw-r--r--layouts/partials/nav.html17
-rw-r--r--layouts/partials/title.html7
-rw-r--r--layouts/post/list-item-expanded.html12
-rw-r--r--layouts/post/list-item.html3
-rw-r--r--layouts/post/single.html21
-rw-r--r--layouts/section/post.html35
-rw-r--r--static/css/paperback.css149
-rw-r--r--theme.toml12
16 files changed, 369 insertions, 0 deletions
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 @@
+<!DOCTYPE html>
+<html lang="{{ .Site.LanguageCode }}">
+
+ {{ partial "head.html" . }}
+
+ <body>
+ <div class="container">
+
+ {{ partial "header.html" . }}
+
+ <section>
+
+ {{ range first (index .Site.Params "HomepagePosts" | default 3) (where .Data.Pages "Type" "post") }}
+ <article>
+ {{ .Render "list-item-expanded" }}
+ </article>
+ {{ end }}
+
+ </section>
+
+ {{ partial "nav.html" . }}
+
+ {{ partial "footer.html" . }}
+
+ </div>
+ </body>
+</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 @@
+<footer class="site-footer">
+ <span class="owner">©2016 {{ .Site.Params.AuthorName }}</span>
+
+ <!-- {{ .Hugo.BuildDate }} -->
+</footer>
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 @@
+
+<head>
+ <meta charset="utf-8">
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <meta name="author" content="{{ .Site.Params.AuthorName }}">
+ {{ .Hugo.Generator }}
+ {{ partial "title" . }}
+ <meta name="description" content="{{ .Description }}">
+ <link rel="canonical" href="{{ .Permalink }}">
+ <link href="{{ .RSSlink }}" rel="alternate" type="application/rss+xml" title="{{ .Site.Title }}">
+ <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Code+Pro|Arvo:400,700">
+ <link rel="stylesheet" href="{{ .Site.BaseURL }}css/paperback.css">
+</head>
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 @@
+<header>
+ <h1>{{ .Title }}</h1>
+
+ {{ if ne .IsNode true }}
+ <time datetime="{{ .Date }}">{{ dateFormat "2006/01/02" .Date }}</time>
+ {{ end }}
+
+ {{ if and .IsHome (isset .Site.Params "Tagline") }}
+ <p>{{ .Site.Params.Tagline }}</p>
+ {{ end }}
+</header>
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 @@
+<nav class="site-nav">
+ <a href="{{ .Site.BaseURL }}">Home</a>
+ <a href="{{ .Site.BaseURL }}post/">All posts</a>
+
+ {{ if eq .Site.Params.SocialLinks true -}}
+
+ {{ if isset .Site.Params "TwitterUsername" -}}
+ <a href="https://twitter.com/{{ .Site.Params.TwitterUsername }}">Twitter</a>
+ {{- end }}
+
+ {{ if isset .Site.Params "GithubUsername" -}}
+ <a href="http://github.com/{{ .Site.Params.GithubUsername }}">GitHub</a>
+ {{- end }}
+
+ {{- end }}
+
+</nav>
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 @@
+<title>
+ {{- if eq .IsHome true -}}
+ {{ .Site.Title }}
+ {{- else -}}
+ {{ .Title }} — {{ .Site.Title }}
+ {{- end -}}
+</title>
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 @@
+<h2><a href="{{ .Permalink }}">{{ .Title }}</a></h2>
+<div>
+ {{ if .Truncated }}
+ {{ .Summary }}
+
+ <footer>
+ <a href="{{ .Permalink }}">Read more</a>
+ </footer>
+ {{ else }}
+ {{ .Content }}
+ {{ end }}
+</div>
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 @@
+<p>
+ <a href="{{ .Permalink }}">{{ .Title }}</a>
+</p>
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 @@
+<!DOCTYPE html>
+<html lang="{{ .Site.LanguageCode }}">
+
+ {{ partial "head.html" . }}
+
+ <body>
+ <div class="container">
+
+ {{ partial "header.html" . }}
+
+ <article>
+ {{ .Content }}
+ </article>
+
+ {{ partial "nav.html" . }}
+
+ {{ partial "footer.html" . }}
+
+ </div>
+ </body>
+</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 @@
+<!DOCTYPE html>
+<html lang="{{ .Site.LanguageCode }}">
+
+ {{ partial "head.html" . }}
+
+ <body>
+ <div class="container">
+
+ {{ partial "header.html" . }}
+
+ <article>
+
+ {{ range (where .Data.Pages "Type" "post").GroupByDate "2006/01" -}}
+ <section>
+ <h2>{{ .Key }}</h2>
+
+ <ol>
+ {{ range .Pages -}}
+ <li>
+ {{ .Render "list-item" }}
+ </li>
+ {{ end }}
+ </ol>
+ </section>
+ {{ end }}
+
+ </article>
+
+ {{ partial "nav.html" . }}
+
+ {{ partial "footer.html" . }}
+
+ </div>
+ </body>
+</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"