Index page more configurable using site config file

This commit is contained in:
Christoffer Müller Madsen 2017-08-06 03:36:46 +02:00
parent 9a2399575c
commit cf3d0db173
2 changed files with 27 additions and 17 deletions

View File

@ -1,18 +1,27 @@
{{ partial "header.html" . }}
{{ if .Site.Params.contact }}
<h2>Contact</h2>
email: <span class="emailaddr">christoffer (at) guava.space</span>
<br>
<h2>Writings</h2>
<ul>
{{ range first 10 .Data.Pages }}
{{ range $label, $value := .Site.Params.contact }}
{{ $label }}: <span class="monospace">{{ $value }}</span>
<br>
{{ end }}
{{ end }}
<h2>Writings</h2>
<ul>
{{ range first .Site.Params.frontPagePosts .Data.Pages }}
{{ if eq .Type "post" }}
<li><a href="{{ .Permalink }}">{{ .Title }} ({{ .Date.Format "Jan 2, 2006" }})</a></li>
<li><a href="{{ .Permalink }}">{{ .Title }}
{{ if .Site.Params.frontShowDatesOnPosts }} ({{ .Date.Format "Jan 2, 2006" }}){{ end }}
</a></li>
{{ end }}
{{ end }}
</ul>
{{ if gt (len (where (where .Site.Pages "Type" "post") "Kind" "page")) .Site.Params.frontPagePosts }}
<a href="{{ .Site.BaseURL }}/post/">List of all writings</a>
{{ end }}
<h2>Pages</h2>
<ul>
{{ range .Data.Pages }}
@ -21,13 +30,14 @@
{{ end }}
{{ end }}
</ul>
<h2>Where to find me on the internet</h2>
{{ if .Site.Params.sites }}
<h2>Where to find me on the internet</h2>
<ul>
<li><a href="{{.Site.BaseURL}}">Right here!</a></li>
<li><a href="https://keybase.io/kipari">Keybase</a></li>
<li><a href="http://mango.thedevcave.net/christoffermadsen">GitLab (mango)</a></li>
<li><a href="https://www.flickr.com/photos/62108810@N04/">Flickr</a></li>
<li><a href="#">WCD (RIP)</a>, <a href="#">PTP</a>, <a href="#">BTN</a></li>
{{ range .Site.Params.sites }}
<li><a href="{{ .link }}">{{ .label }}</a></li>
{{ end }}
</ul>
{{ end }}
{{ partial "footer.html" . }}

View File

@ -59,7 +59,7 @@ ul.covers {
list-style: none;
}
.emailaddr {
.monospace {
font-family: monospace;
}
@ -74,4 +74,4 @@ td {
th {
border-bottom: 1px solid #aaa;
}
}