Show lists with content

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

@ -49,9 +49,11 @@ googleAnalytics = "UA-136337666-1"
# Metadata mostly used in document's head # 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." 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 = [""] images = [""]
showReadingTimeInList = false
homeSubtitle = "Maik de Kruif (maik_dev)" homeSubtitle = "Maik de Kruif (maik_dev)"
# Prefix of link to the git commit detail page. GitInfo must be enabled. # Prefix of link to the git commit detail page. GitInfo must be enabled.

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