|
1 | 1 | {{ define "main" }} |
2 | | - <main class="post"> |
| 2 | + <div class="content"> |
| 3 | + <main class="post"> |
3 | 4 |
|
4 | | - <div class="post-info"> |
5 | | - {{ if .IsTranslated }} |
6 | | - {{ i18n "postAvailable" }} |
7 | | - {{ range .Translations }} |
8 | | - <a href="{{ .Permalink }}"><span class="flag fi fi-{{ index $.Site.Data.langFlags (.Lang) }}"></span></a> |
9 | | - {{ end}} |
10 | | - {{ end }} |
11 | | - </p> |
12 | | - </div> |
| 5 | + <div class="post-info"> |
| 6 | + {{ if .IsTranslated }} |
| 7 | + {{ i18n "postAvailable" }} |
| 8 | + {{ range .Translations }} |
| 9 | + <a href="{{ .Permalink }}"><span class="flag fi fi-{{ index $.Site.Data.langFlags (.Lang) }}"></span></a> |
| 10 | + {{ end}} |
| 11 | + {{ end }} |
| 12 | + </p> |
| 13 | + </div> |
13 | 14 |
|
14 | | - <article> |
15 | | - <h2 class="post-title"><a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></h2> |
| 15 | + <article> |
| 16 | + <h2 class="post-title"><a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></h2> |
16 | 17 |
|
17 | | - {{ if .Params.Cover }} |
18 | | - <figure class="post-cover"> |
19 | | - <img src="{{ .Params.Cover | absURL }}" alt="{{ .Title }}" /> |
| 18 | + {{ if .Params.Cover }} |
| 19 | + <figure class="post-cover"> |
| 20 | + <img src="{{ .Params.Cover | absURL }}" alt="{{ .Title }}" /> |
| 21 | + |
| 22 | + {{ if .Params.CoverCaption }} |
| 23 | + <figcaption class="center">{{ .Params.CoverCaption | markdownify }}</figcaption> |
| 24 | + {{ end }} |
| 25 | + </figure> |
| 26 | + {{ end }} |
20 | 27 |
|
21 | | - {{ if .Params.CoverCaption }} |
22 | | - <figcaption class="center">{{ .Params.CoverCaption | markdownify }}</figcaption> |
23 | | - {{ end }} |
24 | | - </figure> |
25 | | - {{ end }} |
26 | | - |
27 | | - {{ if .Params.toc }} |
28 | | - <hr /> |
29 | | - <aside id="toc"> |
30 | | - <div class="toc-title">{{ i18n "tableOfContents" }}</div> |
31 | | - {{ .TableOfContents }} |
32 | | - </aside> |
33 | | - <hr /> |
34 | | - {{ end }} |
| 28 | + {{ if .Params.toc }} |
| 29 | + <hr /> |
| 30 | + <aside id="toc"> |
| 31 | + <div class="toc-title">{{ i18n "tableOfContents" }}</div> |
| 32 | + {{ .TableOfContents }} |
| 33 | + </aside> |
| 34 | + <hr /> |
| 35 | + {{ end }} |
35 | 36 |
|
36 | | - <div class="post-content"> |
37 | | - {{ .Content }} |
38 | | - </div> |
39 | | - </article> |
| 37 | + <div class="post-content"> |
| 38 | + {{ .Content }} |
| 39 | + </div> |
| 40 | + </article> |
40 | 41 |
|
41 | | - <hr /> |
| 42 | + <hr /> |
42 | 43 |
|
43 | | - <div class="post-info"> |
44 | | - {{ partial "tags.html" .Params.tags }} |
45 | | - {{ partial "categories.html" . }} |
| 44 | + <div class="post-info"> |
| 45 | + {{ partial "tags.html" .Params.tags }} |
| 46 | + {{ partial "categories.html" . }} |
46 | 47 |
|
47 | | - {{- if .GitInfo }} |
48 | | - <p><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-git-commit"><circle cx="12" cy="12" r="4"></circle><line x1="1.05" y1="12" x2="7" y2="12"></line><line x1="17.01" y1="12" x2="22.96" y2="12"></line></svg><a href="{{ .Site.Params.gitUrl -}}{{ .GitInfo.Hash }}" target="_blank" rel="noopener">{{ .GitInfo.AbbreviatedHash }}</a> @ {{ if .Site.Params.dateformNum }}{{ dateFormat .Site.Params.dateformNum .GitInfo.AuthorDate.Local }}{{ else }}{{ dateFormat "2006-01-02" .GitInfo.AuthorDate.Local }}{{ end }}</p> |
49 | | - {{- end }} |
50 | | - </div> |
51 | | - </main> |
| 48 | + {{- if .GitInfo }} |
| 49 | + <p><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-git-commit"><circle cx="12" cy="12" r="4"></circle><line x1="1.05" y1="12" x2="7" y2="12"></line><line x1="17.01" y1="12" x2="22.96" y2="12"></line></svg><a href="{{ .Site.Params.gitUrl -}}{{ .GitInfo.Hash }}" target="_blank" rel="noopener">{{ .GitInfo.AbbreviatedHash }}</a> @ {{ if .Site.Params.dateformNum }}{{ dateFormat .Site.Params.dateformNum .GitInfo.AuthorDate.Local }}{{ else }}{{ dateFormat "2006-01-02" .GitInfo.AuthorDate.Local }}{{ end }}</p> |
| 50 | + {{- end }} |
| 51 | + </div> |
| 52 | + </main> |
| 53 | + </div> |
52 | 54 | {{ end }} |
0 commit comments