Compare commits

...

2 Commits

Author SHA1 Message Date
Jez Cope 1a5a3f3d97 Add 404 page template 2021-04-10 20:59:13 +01:00
Jez Cope c802241deb Include topics in meta description tag 2021-04-09 20:35:44 +01:00
2 changed files with 32 additions and 1 deletions

26
layouts/404.html Normal file
View File

@ -0,0 +1,26 @@
{{ define "main" }}
<section class="hero is-warning is-medium">
<div class="hero-body">
<div class="container">
<div class="columns">
<main class="column is-8 is-offset-2">
<p class="title">
Page not found
</p>
<div class="content">
<p>
You could:
</p>
<ul>
<li><a href="{{ "/" | relURL }}">Go back to the home page</a></li>
<li><a href="{{ "/tags/" | relURL }}">Take a look at the list of tags</a></li>
<li><a href="https://duckduckgo.com">Try searching for what you're looking for</a></li>
</ul>
</div>
</main>
</div>
</div>
</div>
</section>
{{ end }}

View File

@ -5,7 +5,12 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>{{ .Title }}</title>
{{ with .Site.Params.description }}<meta name="description" content="{{ . }}">{{ end }}
{{ .Scratch.Set "desc" slice }}
{{ with .Site.Params.description }}{{ $.Scratch.Add "desc" (slice .) }}{{ end }}
{{ with .Site.Params.topics }}{{ $.Scratch.Add "desc" (slice (delimit . " & ")) }}{{ end }}
{{ if gt (len (.Scratch.Get "desc")) 0 }}
<meta name="description" content="{{ delimit (.Scratch.Get "desc") " " }}">
{{ end }}
{{ with .Site.Params.author }}<meta name="author" content="{{ . }}">{{ end }}
{{ $style := resources.Get "style/main.sass" | resources.ToCSS }}
<link rel="stylesheet" href="{{ $style.RelPermalink }}">