Lists posts no content

This commit is contained in:
Hesam Panahi 2022-09-27 21:41:00 -05:00 committed by GitHub
parent a321bc59ee
commit bf33bb7e20
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,58 +1,19 @@
{{ define "main" }} {{ define "main" }}
{{ with .Content }} <main>
<div class="index-content"> <article>
{{ . }} <header>
</div> <h1>{{.Title}}</h1>
{{ end }} </header>
<div class="posts"> <!-- "{{.Content}}" pulls from the markdown content of the corresponding _index.md -->
{{.Content}}
</article>
<ul>
<!-- Ranges through content/posts/*.md -->
{{ range .Pages }} {{ range .Pages }}
<div class="post on-list"> <li>
<h1 class="post-title"> <a href="{{.Permalink}}">{{.Date.Format "2006-01-02"}} | {{.Title}}</a>
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a> </li>
</h1>
<div class="post-meta">
<span class="post-date">
{{ .Date.Format "2006-01-02" }}
</span>
{{ with .Params.Author }}
<span class="post-author">:: {{ . }}</span>
{{ end }} {{ end }}
</div> </ul>
</main>
{{ if .Params.tags }}
<span class="post-tags">
{{ range .Params.tags }}
#<a href="{{ (urlize (printf "tags/%s/" . )) | absLangURL }}">
{{- . -}}
</a>&nbsp;
{{ end }}
</span>
{{ end }}
{{ if .Params.Cover }}
<img src="{{ .Params.Cover | absURL }}" class="post-cover" alt="{{ .Title | plainify | default " " }}" />
{{ end }}
<div class="post-content">
{{ if .Params.showFullContent }}
{{ .Content | markdownify }}
{{ else if .Description }}
{{ .Description | markdownify }}
{{ else }}
{{ if .Truncated }}
{{ .Summary }}
{{ end }}
{{ 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 }} {{ end }}