source: tanzpartie-hugo/themes/bilberry-hugo-theme/layouts/partials/default-content.html

Last change on this file was 16971, checked in by Henrik Bettermann, 2 years ago
File size: 2.2 KB
Line 
1<div class="content">
2    <h1 class="article-title">
3        <a href="{{ .ctx.Permalink }}">
4            {{ .ctx.Title }}
5        </a>
6    </h1>
7
8    <div class="meta">
9        {{ if ( .ctx.Params.showDate | default true ) }}
10            {{ if ( .ctx.Site.Params.enableMomentJs | default true ) }}
11                <span class="date moment">{{ .ctx.PublishDate.Format "2006-01-02" }}</span>
12            {{ else }}
13                <span class="date">{{ .ctx.PublishDate.Format (.ctx.Site.Params.DateFormat | default "2006-01-02") }}</span>
14            {{ end }}
15        {{ end }}
16
17        {{ if ( .ctx.Site.Params.showReadingTime | default false ) }}
18            {{ if .ctx.Params.readingTime }}
19                <span class="readingTime">{{ i18n "readingTime" .ctx.Params.readingTime }}</span>
20            {{ else }}
21                <span class="readingTime">{{ i18n "readingTime" .ctx.ReadingTime }}</span>
22            {{ end }}
23        {{ end }}
24
25        {{ with .ctx.Params.categories }}
26            <span class="categories">
27                {{ range . }}
28                    {{ $urlValue := replace . " " "-" | lower}}
29                    {{ with $.ctx.Site.GetPage (printf "/categories/%s" $urlValue) }}
30                        <a href="{{ .Permalink }}">{{ .Title }}</a>
31                    {{ end }}
32                {{ end }}
33            </span>
34        {{ end }}
35
36        {{ with .ctx.Params.author }}
37            <span class="author">
38                {{ $urlValue := replace . " " "-" | lower}}
39                {{ with $.ctx.Site.GetPage (printf "/author/%s" $urlValue ) }}
40                    <a href="{{ .Permalink }}">{{ .Title }}</a>
41                {{ end }}
42            </span>
43        {{ end }}
44    </div>
45
46    {{ if or (eq .template_type "single") (.ctx.Params.noSummary) }}
47        {{ if and (gt .ctx.WordCount .ctx.Site.Params.tocMinWordCount ) (.ctx.Params.toc) }}
48            <h2>{{ i18n "tableOfContents" | default "tableOfContents" }}</h2>
49            {{ .ctx.TableOfContents }}
50        {{ end }}
51
52        {{ .ctx.Content }}
53    {{ else }}
54        {{ .ctx.Summary }}
55
56        {{ if .ctx.Truncated }}
57            <a href="{{ .ctx.Permalink }}" class="more">{{ i18n "continueReading" }}</a>
58        {{ end }}
59    {{ end }}
60</div>
Note: See TracBrowser for help on using the repository browser.