diff options
Diffstat (limited to 'themes/new_theme/layouts/index.html')
-rw-r--r-- | themes/new_theme/layouts/index.html | 68 |
1 files changed, 22 insertions, 46 deletions
diff --git a/themes/new_theme/layouts/index.html b/themes/new_theme/layouts/index.html index 77fbd4a..9250441 100644 --- a/themes/new_theme/layouts/index.html +++ b/themes/new_theme/layouts/index.html @@ -1,48 +1,24 @@ -{{ partial "header.html" . }} - -{{ $section := .Section }} - -{{ if ne $section "blog" }} -<div class="main-content content" role="main" itemprop="mainContentOfPage"> - <article class="post"> - <header class="post__header clearfix"> - <h1 class="post__title">{{ .Title }}</h1> - </header> - <div class="post__content clearfix"> - {{ .Content }} +{{ define "main" }} +<main class="main list" role="main"> + {{- with .Content }} + <div class="content main__content clearfix"> + {{ . }} + </div> + {{- end }} + {{ $paginator := .Paginate (where .Site.RegularPages "Type" "in" .Site.Params.mainSections) }} + {{- range $paginator.Pages }} + {{- .Render "summary" }} + {{- end }} + {{- if and (eq $paginator.TotalNumberOfElements 0) (not $.Content) }} + <div class="warning"> + {{ partial "svg/files.svg" (dict "class" "warning__icon") }} + <h3 class="warning__headline">{{ T "noposts_warning_title" | safeHTML }}</h3> + <div class="warning__text"> + <p class="warning__description">{{ T "noposts_warning_description" | safeHTML }}</p> + <p class="warning__tip">{{ T "noposts_warning_tip" | safeHTML }}</p> + </div> </div> - </article> -</div> -{{ else }} -<div class="main-content content" role="main" itemprop="mainContentOfPage"> - <article class="post"> - <header class="post__header clearfix"> - <h1 class="post__title">{{ .Title }}</h1> - <p class="post__meta meta"> - <svg class="icon icon-time" height="14" viewBox="0 0 16 16" width="14" xmlns="http://www.w3.org/2000/svg"><path d="m8-.0000003c-4.4 0-8 3.6-8 8 0 4.4000003 3.6 8.0000003 8 8.0000003 4.4 0 8-3.6 8-8.0000003 0-4.4-3.6-8-8-8zm0 14.4000003c-3.52 0-6.4-2.88-6.4-6.4000003 0-3.52 2.88-6.4 6.4-6.4 3.52 0 6.4 2.88 6.4 6.4 0 3.5200003-2.88 6.4000003-6.4 6.4000003zm.4-10.4000003h-1.2v4.8l4.16 2.5600003.64-1.04-3.6-2.1600003z"/></svg> - <time class="post__meta-date" datetime="{{ .Date }}">{{.Date.Format "January 02, 2006"}}</time> - {{- if .Params.categories }} - <span class="post__meta-categories meta-categories"> - <svg class="icon icon-category" height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"><path d="m7 2l1 2h8v11h-16v-13z"/></svg> - {{ range $index, $category := .Params.categories }}{{ if gt $index 0 }}, {{ end }}<a class="meta-categories__link" href="{{ "/categories/" | relLangURL }}{{ . | urlize | lower }}" rel="category">{{ . }}</a>{{ end }}</span> - {{- end }} - </p> - </header> - <div class="post__content clearfix"> - {{- if .Params.thumbnail }} - <figure class="post__thumbnail"> - <img src="{{ .Params.thumbnail | absURL }}" alt="{{ .Title }}"> - </figure> - {{- end }} - {{ .Content }} - </div> - {{ partial "post_tags.html" . }} - </article> - {{ partial "authorbox.html" . }} - {{ partial "post_nav.html" . }} - {{ partial "comments.html" . }} -</div> + {{ end }} +</main> +{{ partial "pagination.html" . }} {{ end }} - -{{ partial "sidebar.html" . }} -{{ partial "footer.html" . }} |