Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/danielkvist/hugo-piercer-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordanielkvist <d94.zaragoza@gmail.com>2019-04-03 11:35:48 +0300
committerdanielkvist <d94.zaragoza@gmail.com>2019-04-03 12:16:30 +0300
commit65f630397fb5b106635a969707534da1d914b04f (patch)
tree1b8f870bffe26de8b97e5970a6ed53289e463962
parent54d5ebd51ccfd52e181a2dbcf2091866db3f561a (diff)
add 404 template
-rw-r--r--README.md7
-rw-r--r--assets/css/style.css8
-rw-r--r--exampleSite/config.toml3
-rw-r--r--layouts/404.html17
4 files changed, 35 insertions, 0 deletions
diff --git a/README.md b/README.md
index 0c83836..d498682 100644
--- a/README.md
+++ b/README.md
@@ -225,6 +225,13 @@ logo = "" # Relative URL for your logo
message = "" # You can use HTML tags
```
+### 404
+
+```toml
+[params.notfound]
+ message = ""
+```
+
## Archetypes
Piercer includes three archetypes:
diff --git a/assets/css/style.css b/assets/css/style.css
index 79c9bd4..add26fb 100644
--- a/assets/css/style.css
+++ b/assets/css/style.css
@@ -172,4 +172,12 @@
.footer__copy {
padding-bottom: 1.25rem;
+}
+
+/* 404 */
+.notfound {
+ align-items: center;
+ display: flex;
+ font-size: var(--h1);
+ justify-content: center;
} \ No newline at end of file
diff --git a/exampleSite/config.toml b/exampleSite/config.toml
index b765fae..47ebdcd 100644
--- a/exampleSite/config.toml
+++ b/exampleSite/config.toml
@@ -117,3 +117,6 @@ themesDir = "../.."
[params.agreement]
message = "Piercer uses <a href=\"#\" alt=\"font awesome\">Font Awesome</a>. The content of the home page comes from <a href=\"#\" alt=\"Wikipedia\">Wikipedia</a>. The content of the blog posts and the about page comes from the <a href=\"#\" alt=\"Hugo Example Site\">Hugo Example Site</a>. The Dracula's image is scary."
+
+[params.notfound]
+ message = "" \ No newline at end of file
diff --git a/layouts/404.html b/layouts/404.html
index e69de29..6bba9ef 100644
--- a/layouts/404.html
+++ b/layouts/404.html
@@ -0,0 +1,17 @@
+{{ define "main" }}
+
+<div class="single__content notfound">
+ <h1>
+ {{ if $.Site.Params.notfound }}
+ {{ if $.Site.Params.notfound.message }}
+ {{ $.Site.Params.notfound.message }}
+ {{ else }}
+ 404
+ {{end }}
+ {{ else }}
+ 404
+ {{ end}}
+ </h1>
+</div>
+
+{{ end }} \ No newline at end of file