website/layouts/index.html
2020-11-09 20:16:31 +01:00

72 lines
2.4 KiB
HTML

{{ define "stylesheet" }}{{ $scss := resources.Get "/index.scss" }}{{ $style := $scss | resources.ToCSS }}
<link rel="stylesheet" href="{{ $style.Permalink }}" type="text/css" media="screen" />
{{ end }}
{{ define "main" }}
<section class="section header">
<div class="container">
<header>
<h1>{{ .Params.heading }}</h1>
<span class="subtitle">{{.Params.subheading}}</span>
</header>
<section class="section contact">
<table class="table contact">
{{ range sort .Params.contact "weight" "asc" }}
<tr>
<td>{{ .name }}</td>
<td>
{{ with .url }}<a href="{{ . }}">{{ end }}
{{ .handle }}
{{ with .url }}</a>{{ end }}
{{ with .hint }}<a href="{{ .url }}">{{ .name }}</a>{{ end }}
</td>
</tr>
{{ end }}
</table>
</section>
</div>
</section>
<main>
<div class="container">
<span class="section latest">
latest
<a href="{{ "/blog" | relURL }}">posts</a>
</span>
<section class="section articles">
{{ range first 2 (where .Site.RegularPages "Type" "post") }}
<a href="{{ .Permalink }}">
<article>
<h1>{{ .Title }}</h1>
<p class="meta" title="{{ .Date.Format "2 Jan 2006, 15:04 MST" }}">
<span class="date">{{ .Date.Format "2 January 2006" }}</span>
<span class="author">{{ with .Params.author }}by {{ end }}{{ .Params.author }}</span>
</p>
{{ with .Description }}
<p>{{ . }}</p>
{{ end }}
{{ with .Params.featured_image }}
<img src="{{ . | relURL }}" alt="">
{{ end }}
</article>
</a>
{{ end }}
</section>
<span class="section latest">
latest
<a href="{{ "/projects" | relURL }}">projects</a>
</span>
<section class="section projects">
{{ range first 3 (where .Site.RegularPages "Type" "project") }}
<a href="{{ .Permalink }}">
<article>
<h1>{{ .Title }}</h1>
<p class="meta">{{ with .Params.activetime }}<span class="date">{{ . }}</span>{{ end }} {{ with .Params.status }}<span class="status">{{ . }}</span>{{ end }}</p>
{{ with .Description }}<p>{{ . }}</p>{{ end }}
<img {{ with .Params.featured_image }}src="{{ . | relURL }}"{{ end }} alt="">
</article>
</a>
{{ end }}
</section>
</div>
</main>
{{ end }}