Show lists with content

pull/4/head
Maik de Kruif 3 years ago
parent dd4c43a9d4
commit f307dfe308
No known key found for this signature in database
GPG Key ID: 46C1200ACD3A432F
  1. 4
      config.toml
  2. 95
      themes/maik-blog/layouts/_default/list.html

@ -49,9 +49,11 @@ googleAnalytics = "UA-136337666-1"
# Metadata mostly used in document's head
description = "Hey there, my name is Maik de Kruif, I create websites, bots and other kinds of software. At the moment, I'm still studying computer science at Avans University of Applied Sciences. I am also a big fan of open-source software, which is why you'll find many of my projects on Github. And last but not least, I love playing around with cyber-security related stuff."
keywords = ""
keywords = "" # TODO: Add keywords!!!
images = [""]
showReadingTimeInList = false
homeSubtitle = "Maik de Kruif (maik_dev)"
# Prefix of link to the git commit detail page. GitInfo must be enabled.

@ -1,35 +1,72 @@
{{ define "main" }}
{{ $paginator := .Paginate .Data.Pages }}
<main class="posts">
<h1>{{ .Title }}</h1>
{{ $paginator := .Paginate .Data.Pages }}
{{ if .Content }}
<div class="content">{{ .Content }}</div>
{{ end }}
<main class="posts">
<h1>{{ .Title }}</h1>
{{ if .Content }}
<div class="content">{{ .Content }}</div>
{{ end }}
<div class="posts-list">
{{ range .Pages }}
<div class="post">
<h1 class="post-title"><a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></h1>
<div class="post-meta">
{{ if .Date }}
<span class="post-date">
{{ .Date.Format ($.Site.Params.DateFormatList | default "2006-01-02") }}
</span>
{{ range $paginator.Pages.GroupByDate "2006" }}
<div class="posts-group">
<div class="post-year">{{ .Key }}</div>
<ul class="posts-list">
{{ range .Pages }}
<li class="post-item">
<a href="{{.Permalink}}">
<span class="post-title">{{.Title}}</span>
<span class="post-day">
{{ if .Site.Params.dateformShort }}
{{ .Date.Format .Site.Params.dateformShort }}
{{ else }}
{{ .Date.Format "Jan 2"}}
{{ end }}
</span>
</a>
</li>
{{ end }}
</ul>
{{ end }}
{{ with .Params.Author }}<span class="post-author">{{ $.Site.Params.WrittenBy | default "Written by" }}
{{ . }}</span>{{ end }}
{{ if $.Site.Params.ShowReadingTimeInList }}
<span class="post-read-time">— {{ .ReadingTime }}
{{ $.Site.Params.MinuteReadingTime | default "min read" }}</span>
{{ end }}
</div>
{{ if .Params.tags }}
<span class="post-tags">
{{ range .Params.tags }}
#<a href="{{ (urlize (printf "tags/%s" . )) | absURL }}/">{{ . }}</a>&nbsp;
{{ end }}
</span>
{{ end }}
{{ if .Params.Cover }}
<figure class="post-cover">
{{ if .Params.UseRelativeCover }}
<img src="{{ (printf "%s%s" .Permalink .Params.Cover ) }}"
alt="{{ .Title | plainify | default " " }}" />
{{ else }}
<img src="{{ .Params.Cover | absURL }}" alt="{{ .Title | plainify | default " " }}" />
{{ end }}
{{ if .Params.CoverCaption }}
<figcaption class="center">{{ .Params.CoverCaption | markdownify }}</figcaption>
{{ end }}
</figure>
{{ end }}
<div class="post-content">
{{ with .Description }}
{{ . | markdownify }}
{{ else }}
{{ if .Truncated }}
{{ .Summary | markdownify }}
{{ end }}
{{ end }}
</div>
{{ if not .Params.hideReadMore }}
<div><a class="read-more button" href="{{.RelPermalink}}">{{ $.Site.Params.ReadMore | default "Read more" }}
</a></div>
{{ end }}
</div>
{{ end }}
</div>
{{ partial "pagination.html" . }}
</main>
{{ end }}
</main>
{{ end }}
Loading…
Cancel
Save