use {{ now }} instead of {{ .Site.Params.version }}; added errorpages

This commit is contained in:
Vrifox 2020-09-22 15:18:28 +02:00
parent fb24b7e480
commit 6cf10d85cd
12 changed files with 316 additions and 74 deletions

View file

@ -1,29 +0,0 @@
{{ define "stylesheet" }}{{ $sass := resources.Get "scss/index.scss" }}{{ $style := $sass | resources.ToCSS }}
<link rel="stylesheet" href="{{ $style.Permalink }}" type="text/css" media="screen" />
{{ end }}
{{ define "main" }}
<main class="container">
<section>
<header>
<h1>{{ .Params.heading }}</h1>
<span class="subtitle">{{.Params.subheading}}</span>
</header>
{{.Content}}
</section>
<section class="section-articles">
{{ range first 3 (where .Site.RegularPages "Type" "post") }}
<article>
<h1><a href="{{ .Permalink }}">{{ .Title }}</a></h1>
<p class="date" title="{{ .Date.Format "2 Jan 2006, 15:04 MST" }}">{{ .Date.Format "2 January 2006" }}</p>
{{ with .Description }}
<p>{{ . }}</p>
{{ end }}
{{ with .Params.featured_image }}
<img src="{{ . | absURL }}">
{{ end }}
</article>
{{ end }}
</section>
</main>
{{ end }}

View file

@ -0,0 +1,18 @@
{{ define "stylesheet" }}{{ $sass := resources.Get "scss/errorpages.scss" }}{{ $style := $sass | resources.ToCSS }}
<link rel="stylesheet" href="{{ $style.Permalink }}" type="text/css" media="screen" />
{{ end }}
{{ define "main" }}
<main>
<div class="container">
<section>
<header>
<h1>{{ .Params.heading }}</h1>
<span class="subtitle">{{.Params.subheading}}</span>
</header>
{{.Content}}
</section>
</div>
</main>
{{ end }}

View file

@ -0,0 +1,17 @@
{{ define "stylesheet" }}{{ $sass := resources.Get "scss/errorpages.scss" }}{{ $style := $sass | resources.ToCSS }}
<link rel="stylesheet" href="{{ $style.Permalink }}" type="text/css" media="screen" />
{{ end }}
{{ define "main" }}
<main>
<div class="container">
<section>
<header>
<h1>{{ .Params.heading }}</h1>
<span class="subtitle">{{.Params.subheading}}</span>
</header>
{{.Content}}
</section>
</div>
</main>
{{ end }}

View file

@ -3,43 +3,45 @@
{{ end }}
{{ define "main" }}
<main class="container">
<section>
<header>
<h1>{{ .Params.heading }}</h1>
<span class="subtitle">{{.Params.subheading}}</span>
</header>
{{.Content}}
</section>
<h1>latest <a href="{{ "/blog" | relURL }}">posts</a></h1>
<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">by {{ .Params.author }}</span></p>
{{ with .Description }}
<p>{{ . }}</p>
{{ end }}
{{ with .Params.featured_image }}
<img src="{{ . | relURL }}">
{{ end }}
</article>
</a>
{{ end }}
</section>
<h1>latest <a href="{{ "/projects" | relURL }}">projects</a></h1>
<section class="section-projects">
{{ range first 3 (where .Site.RegularPages "Type" "project") }}
<a href="{{ .Permalink }}">
<article>
<h1>{{ .Title }}</h1>
<p class="meta" title="last change: {{ .Date.Format "2 Jan 2006" }}">{{ 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 }}>
</article>
</a>
{{ end }}
</section>
<main>
<div class="container">
<section>
<header>
<h1>{{ .Params.heading }}</h1>
<span class="subtitle">{{.Params.subheading}}</span>
</header>
{{.Content}}
</section>
<h1>latest <a href="{{ "/blog" | relURL }}">posts</a></h1>
<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">by {{ .Params.author }}</span></p>
{{ with .Description }}
<p>{{ . }}</p>
{{ end }}
{{ with .Params.featured_image }}
<img src="{{ . | relURL }}">
{{ end }}
</article>
</a>
{{ end }}
</section>
<h1>latest <a href="{{ "/projects" | relURL }}">projects</a></h1>
<section class="section-projects">
{{ range first 3 (where .Site.RegularPages "Type" "project") }}
<a href="{{ .Permalink }}">
<article>
<h1>{{ .Title }}</h1>
<p class="meta" title="last change: {{ .Date.Format "2 Jan 2006" }}">{{ 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 }}>
</article>
</a>
{{ end }}
</section>
</div>
</main>
{{ end }}

View file

@ -1,7 +1,7 @@
<footer>
<div class="container">
<section class="website-version">
<span>version {{ .Site.Params.version }}</span>
<span title="{{ now.Format "2. January 2006, 15:04 MST" }}">version {{ now.Format "2006-01-02" }}</span>
</section>
<section class="website-subnav">
<ul>