summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--exampleSite/config.toml11
-rw-r--r--layouts/_default/baseof.html2
-rw-r--r--layouts/_default/teaser.html20
-rw-r--r--layouts/index.html44
-rw-r--r--layouts/partials/post-meta.html9
-rw-r--r--layouts/partials/post-meta/date.html11
-rw-r--r--layouts/partials/post-thumbnail.html0
7 files changed, 75 insertions, 22 deletions
diff --git a/exampleSite/config.toml b/exampleSite/config.toml
index 89ce3f6..823c22f 100644
--- a/exampleSite/config.toml
+++ b/exampleSite/config.toml
@@ -13,9 +13,8 @@ resourceDir = '../resources'
languageDirection = "ltr"
[params]
- # Site author name
+ # Site author name. For multiple authors use: ['Me', 'You']
author = 'John Doe'
- # author: ['Me', 'You'] # multiple authors
# Site description. Used in meta description
description = 'Ed is a Hugo theme designed for textual editors based on minimal computing principles, and focused on legibility and flexibility.'
# Color scheme. Options: red, orange, magenta, cyan, blue, brown
@@ -24,6 +23,14 @@ resourceDir = '../resources'
tagline = 'a Hugo theme for minimal editions'
# Custom footer text
footer = ''
+ # Sections to be displayed in the main page
+ main_sections = ['post', 'drama', 'narrative', 'poem']
+ # Order of post meta information
+ post_meta = ['date']
+ # Posts date format, for example: 2006-01-02
+ dateformat = 'January 02, 2006'
+ # Show "Read more" button in list if true
+ readmore = false
[params.assets]
# Relative paths to icons
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
index 98a05bf..149d500 100644
--- a/layouts/_default/baseof.html
+++ b/layouts/_default/baseof.html
@@ -13,7 +13,7 @@
</div>
</header>
- <main class="container content" aria-role="main" id="main">
+ <main class="container content" role="main" id="main">
{{- block "main" . }}{{- end }}
</main>
</div>
diff --git a/layouts/_default/teaser.html b/layouts/_default/teaser.html
new file mode 100644
index 0000000..8e161c1
--- /dev/null
+++ b/layouts/_default/teaser.html
@@ -0,0 +1,20 @@
+<article class="blog-post">
+ {{/* TODO: partial "post-thumbnail.html" (dict "class" "list" "page" .) */}}
+ <header>
+ <h2 class="blog-post-title">
+ <a href="{{ .Permalink }}" rel="bookmark">{{ .Title }}</a>
+ </h2>
+ {{- partial "post-meta.html" . -}}
+ </header>
+ <p class="blog-post-content">
+ {{ .Summary }}
+ </p>
+ {{- if site.Params.readmore }}
+ {{- if .Truncated }}
+ <footer>
+ {{/* TODO: Translate me */}}
+ <a href="{{ .RelPermalink }}" class="read-more">Read more...</a>
+ </footer>
+ {{- end }}
+ {{- end }}
+</article>
diff --git a/layouts/index.html b/layouts/index.html
index e051c4d..2209872 100644
--- a/layouts/index.html
+++ b/layouts/index.html
@@ -1,20 +1,26 @@
-{{ define "main" -}}
-
-<div class="introduction">
- {{ .Content }}
-</div>
-
-<hr>
-
-<div class="toc">
- <h2>Latest Publications</h2>
- <ul class="texts">
- {{ range first 10 (where site.RegularPages "Section" "!=" "" ) }}
- <li class="text-title">
- <a href="{{ .Permalink }}">{{ .Title }}</a>
- </li>
- {{ end }}
- </ul>
-</div>
-
+{{ define "main" }}
+{{- with .Content }}
+ <div class="introduction">
+ {{ . }}
+ </div>
+ <hr>
+ <div class="toc">
+ {{/* TODO: Translate me */}}
+ <h2>Latest Publications</h2>
+ <ul class="texts">
+ {{ range first 10 (where site.RegularPages "Section" "!=" "") }}
+ <li class="text-title">
+ <a href="{{ .Permalink }}">{{ .Title }}</a>
+ </li>
+ {{ end }}
+ </ul>
+ </div>
+{{- else }}
+ {{ $paginator := .Paginate (where site.RegularPages "Type" "in" site.Params.main_sections) }}
+ <div class="articles">
+ {{- range $paginator.Pages }}
+ {{- .Render "teaser" }}
+ {{- end }}
+ </div>
+{{- end }}
{{- end }}
diff --git a/layouts/partials/post-meta.html b/layouts/partials/post-meta.html
new file mode 100644
index 0000000..a539c54
--- /dev/null
+++ b/layouts/partials/post-meta.html
@@ -0,0 +1,9 @@
+<div class="post-meta">
+ {{- $root := . -}}
+ {{- with .Param "post_meta" -}}
+ {{- range $field := . -}}
+ {{- $p := printf "post-meta/%s.html" $field -}}
+ {{- partial $p $root -}}
+ {{- end -}}
+ {{- end -}}
+</div>
diff --git a/layouts/partials/post-meta/date.html b/layouts/partials/post-meta/date.html
new file mode 100644
index 0000000..6afce4c
--- /dev/null
+++ b/layouts/partials/post-meta/date.html
@@ -0,0 +1,11 @@
+{{- if not .Date.IsZero }}
+<time datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">
+ {{- .Date.Format (site.Params.dateformat | default "January 02, 2006") -}}
+</time>
+{{- if ne .Date .Lastmod }}
+<time datetime="{{ .Lastmod.Format "2006-01-02T15:04:05Z07:00" }}">
+ {{- /* TODO: Translate me */}}
+ Updated: {{- .Lastmod.Format (site.Params.dateformat | default "January 02, 2006") -}}
+</time>
+{{- end -}}
+{{- end }}
diff --git a/layouts/partials/post-thumbnail.html b/layouts/partials/post-thumbnail.html
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/layouts/partials/post-thumbnail.html