diff options
Diffstat (limited to 'layouts/_default')
| -rw-r--r-- | layouts/_default/all-posts.html | 36 | ||||
| -rw-r--r-- | layouts/_default/list.html | 4 | ||||
| -rw-r--r-- | layouts/_default/single.html | 4 |
3 files changed, 41 insertions, 3 deletions
diff --git a/layouts/_default/all-posts.html b/layouts/_default/all-posts.html new file mode 100644 index 0000000..319a8d5 --- /dev/null +++ b/layouts/_default/all-posts.html @@ -0,0 +1,36 @@ +{{ define "main" }} +<section class="search-page"> + <header class="all-posts__header"> + <h1 class="all-posts__heading"> + {{ .Title }} + </h1> + {{- with .Content }} + <div class="all-posts__description"> + {{ . }} + </div> + {{- else }} + {{- $description := or .Description (lang.Translate "posts.all_description" | default "All posts on this website, from newest to oldest.") }} + <p class="all-posts__description"> + {{ $description }} + </p> + {{- end }} + </header> + + {{ $allPosts := where site.RegularPages "Params.excludeFromLists" "!=" true }} + {{- if $allPosts }} + <div class="all-posts__content"> + <ul class="all-posts__list" role="list"> + {{- range $allPosts.ByDate.Reverse }} + <li class="all-posts__list-item"> + {{ partial "list/post-card.html" . }} + </li> + {{- end }} + </ul> + </div> + {{ else }} + <p class="all-posts__empty-message"> + {{ lang.Translate "posts.empty" | default "This site does not have any posts yet." }} + </p> + {{- end }} +</section> +{{ end }} diff --git a/layouts/_default/list.html b/layouts/_default/list.html index d3d2d99..a8cb92a 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -17,8 +17,8 @@ </header> <section class="list-page__content" aria-label="{{ lang.Translate "posts.name" | default "Posts" }}"> - {{- /* 20 posts per site */ -}} - {{- $paginator := .Paginate .Pages 20 }} + {{- /* 15 posts per site */ -}} + {{- $paginator := .Paginate .Pages 15 }} {{- with $paginator.Pages }} <ul class="list-page__posts-list"> {{- range . }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 24bc5c9..dba5a10 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -1,7 +1,9 @@ {{- define "main" }} <article class="post"> <header class="post__header"> - <h1 class="post__headline">{{ .Title }}</h1> + <h1 class="post__headline"> + {{ .Title }} + </h1> <time datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}" class="post__publish-date"> {{ .Date | time.Format ":date_medium" }} </time> |
