Fix format

This commit is contained in:
panr 2019-03-31 19:28:38 +02:00
parent 13e0079b23
commit e938e972b6
2 changed files with 80 additions and 71 deletions

View File

@ -17,33 +17,36 @@
</div> </div>
{{ if .Params.tags }} {{ if .Params.tags }}
<span class="post-tags"> <span class="post-tags">
{{ range .Params.tags }} {{ range .Params.tags }}
#<a href="{{ (urlize (printf "tags/%s/" . )) | absURL }}">{{ . }}</a>&nbsp; #<a href="{{ (urlize (printf "tags/%s/" . )) | absURL }}">
{{ end }} {{- . -}}
</span> </a>&nbsp;
{{ end }}
</span>
{{ end }} {{ end }}
{{ with .Params.Cover }} {{ with .Params.Cover }}
<img src="{{ . | absURL }}" class="post-cover" /> <img src="{{ . | absURL }}" class="post-cover" />
{{ end }} {{ end }}
<div class="post-content"> <div class="post-content">
{{ if .Params.showFullContent }} {{ if .Params.showFullContent }}
{{ .Content | markdownify }} {{ .Content | markdownify }}
{{ else if .Description }} {{ else if .Description }}
{{ .Description | markdownify }} {{ .Description | markdownify }}
{{ else }} {{ else }}
{{ if .Truncated }} {{ if .Truncated }}
{{ .Summary | markdownify }} {{ .Summary | markdownify }}
{{ end }} {{ end }}
{{ end }} {{ end }}
</div> </div>
{{ if not .Params.showFullContent }} {{ if not .Params.showFullContent }}
<div> <div>
<a class="read-more button" href="{{.RelPermalink}}">{{ $.Site.Params.ReadMore }} →</a> <a class="read-more button"
</div> href="{{.RelPermalink}}">{{ $.Site.Params.ReadMore }} →</a>
</div>
{{ end }} {{ end }}
</div> </div>
{{ end }} {{ end }}

View File

@ -1,61 +1,67 @@
{{ define "main" }} {{ define "main" }}
<div class="post"> <div class="post">
<h1 class="post-title"><a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></h1> <h1 class="post-title">
<div class="post-meta"> <a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></h1>
<span class="post-date"> <div class="post-meta">
{{ .Date.Format "2006-01-02" }} <span class="post-date">
</span> {{ .Date.Format "2006-01-02" }}
{{ with .Params.Author }}<span class="post-author">:: {{ . }}</span>{{ end }} </span>
</div> {{ with .Params.Author }}
<span class="post-author">::
{{ if .Params.tags }} {{ . }}
<span class="post-tags"> </span>
{{ range .Params.tags }}
#<a href="{{ (urlize (printf "tags/%s/" .)) | absURL }}">{{ . }}</a>&nbsp;
{{ end }}
</span>
{{ end }} {{ end }}
{{ with .Params.Cover }}
<img src="{{ . | absURL }}" class="post-cover" />
{{ end }}
{{ if .Params.Toc }}
<div class="table-of-contents">
{{ .TableOfContents }}
</div>
{{ end }}
<div class="post-content">
{{ .Content }}
</div>
{{ if or .NextInSection .PrevInSection }}
<div class="pagination">
<div class="pagination__title">
<span class="pagination__title-h">{{ $.Site.Params.ReadOtherPosts }}</span>
<hr />
</div>
<div class="pagination__buttons">
{{ if .NextInSection }}
<span class="button previous">
<a href="{{ .NextInSection.Permalink }}">
<span class="button__icon"></span>
<span class="button__text">{{ .NextInSection.Title }}</span>
</a>
</span>
{{ end }}
{{ if .PrevInSection }}
<span class="button next">
<a href="{{ .PrevInSection.Permalink }}">
<span class="button__text">{{ .PrevInSection.Title }}</span>
<span class="button__icon"></span>
</a>
</span>
{{ end }}
</div>
</div>
{{ end }}
{{ partial "comments.html" . }}
</div> </div>
{{ if .Params.tags }}
<span class="post-tags">
{{ range .Params.tags }}
#<a href="{{ (urlize (printf "tags/%s/" .)) | absURL }}">{{ . }}</a>&nbsp;
{{ end }}
</span>
{{ end }}
{{ with .Params.Cover }}
<img src="{{ . | absURL }}" class="post-cover" />
{{ end }}
{{ if .Params.Toc }}
<div class="table-of-contents">
{{ .TableOfContents }}
</div>
{{ end }}
<div class="post-content">
{{ .Content }}
</div>
{{ if or .NextInSection .PrevInSection }}
<div class="pagination">
<div class="pagination__title">
<span
class="pagination__title-h">{{ $.Site.Params.ReadOtherPosts }}</span>
<hr />
</div>
<div class="pagination__buttons">
{{ if .NextInSection }}
<span class="button previous">
<a href="{{ .NextInSection.Permalink }}">
<span class="button__icon"></span>
<span class="button__text">{{ .NextInSection.Title }}</span>
</a>
</span>
{{ end }}
{{ if .PrevInSection }}
<span class="button next">
<a href="{{ .PrevInSection.Permalink }}">
<span class="button__text">{{ .PrevInSection.Title }}</span>
<span class="button__icon"></span>
</a>
</span>
{{ end }}
</div>
</div>
{{ end }}
{{ partial "comments.html" . }}
</div>
{{ end }} {{ end }}