mirror of
https://github.com/foo-dogsquared/website.git
synced 2025-01-31 19:57:57 +00:00
64 lines
1.8 KiB
HTML
64 lines
1.8 KiB
HTML
{{ define "main" }}
|
|
{{ .Content }}
|
|
<div class="posts">
|
|
{{ $isntDefault := not (or (eq (trim $.Site.Params.contentTypeName " ") "posts") (eq (trim $.Site.Params.contentTypeName " ") "")) }}
|
|
{{ $contentTypeName := cond $isntDefault (string $.Site.Params.contentTypeName) "posts" }}
|
|
{{ $paginator := .Paginate (where .Data.Pages "Type" $contentTypeName) }}
|
|
|
|
{{ $blogIcons := "blog-icons.svg" | absURL }}
|
|
{{ range .Data.Pages }}
|
|
<div class="post on-list">
|
|
<div class="post-header-wrapper">
|
|
<h1 class="post-title">
|
|
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
|
|
</h1>
|
|
{{ with .File }}
|
|
<svg class="post-type">
|
|
{{ $isFolder := or (eq .BaseFileName "_index") (eq .BaseFileName "")}}
|
|
{{ $contentType := cond $isFolder "folder" "file" }}
|
|
<use xlink:href="{{ $blogIcons }}#{{ $contentType }}"></use>
|
|
</svg>
|
|
{{ end }}
|
|
</div>
|
|
<div class="post-meta">
|
|
<span class="post-date">
|
|
{{ .Date.Format "2006-01-02" }}
|
|
</span>
|
|
{{ with .Params.Author }}<span class="post-author">::
|
|
{{ . }}</span>{{ end }}
|
|
</div>
|
|
|
|
{{ if .Params.tags }}
|
|
<span class="post-tags">
|
|
{{ range .Params.tags }}
|
|
#<a href="{{ (urlize (printf "tags/%s/" . )) | absLangURL }}">
|
|
{{- . -}}
|
|
</a>
|
|
{{ end }}
|
|
</span>
|
|
{{ end }}
|
|
|
|
{{ with .Params.Cover }}
|
|
<img src="{{ . | absURL }}" class="post-cover" />
|
|
{{ end }}
|
|
|
|
<div class="post-content">
|
|
{{ if .Description }}
|
|
{{ .Description | markdownify }}
|
|
{{ else }}
|
|
{{ .Summary | markdownify }}
|
|
{{ end }}
|
|
</div>
|
|
|
|
{{ if not .Params.showFullContent }}
|
|
<div>
|
|
<a class="read-more button"
|
|
href="{{.RelPermalink}}">{{ $.Site.Params.ReadMore }} →</a>
|
|
</div>
|
|
{{ end }}
|
|
</div>
|
|
{{ end }}
|
|
{{ partial "pagination.html" . }}
|
|
</div>
|
|
{{ end }}
|