Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6d3fb4613b | |||
| ba12b11f03 | |||
| b024424405 | |||
| 0f3258f2db | |||
| 8d367dfa79 |
@@ -1,3 +1,15 @@
|
|||||||
# hugo_bootstrap_theme
|
# hugo_bootstrap_theme
|
||||||
|
|
||||||
Simple Bootstrap-based theme for Hugo.
|
Simple Bootstrap-based theme for Hugo.
|
||||||
|
|
||||||
|
|
||||||
|
## Custom error page
|
||||||
|
|
||||||
|
The theme has a custom 404 error page.
|
||||||
|
|
||||||
|
If the site has an SVG image in `assets/svg/404.svg`,
|
||||||
|
this image will be displayed instead of a generic 404
|
||||||
|
code. Regardless of whether an SVG assets exists or not,
|
||||||
|
English and German explanations of what's going on will
|
||||||
|
be included on the page.
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,47 @@
|
|||||||
|
{{ define "main" }}
|
||||||
|
<div class="container">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col mt-5 mb-5">
|
||||||
|
{{ with resources.Get "svg/404.svg" }}
|
||||||
|
{{ .Content | safeHTML }}
|
||||||
|
{{ else }}
|
||||||
|
<h1 class="display-1 mx-auto text-center">
|
||||||
|
404
|
||||||
|
</h1>
|
||||||
|
{{ end }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-lg-6">
|
||||||
|
<div class="alert alert-danger mb-5" lang="en">
|
||||||
|
<h4 class="alert-heading">
|
||||||
|
Page not found
|
||||||
|
</h4>
|
||||||
|
<p>
|
||||||
|
The page you were trying to navigate to was not found on this
|
||||||
|
server.
|
||||||
|
</p>
|
||||||
|
<hr />
|
||||||
|
<p class="mb-0">
|
||||||
|
<a href="{{ .Site.BaseURL }}" class="alert-link">Back to the home page.</a>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-lg-6">
|
||||||
|
<div class="alert alert-danger" lang="de">
|
||||||
|
<h4 class="alert-heading">
|
||||||
|
Seite nicht gefunden
|
||||||
|
</h4>
|
||||||
|
<p>
|
||||||
|
Die angeforderte Seite existiert nicht auf diesem Server.
|
||||||
|
</p>
|
||||||
|
<hr />
|
||||||
|
<p class="mb-0">
|
||||||
|
<a href="{{ .Site.BaseURL }}" class="alert-link">Zurück zur Homepage.</a>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
{{/* Call this with a resource's content e.g., partial "human_file_size" .Content */}}
|
||||||
|
{{- $bytes := len . -}}
|
||||||
|
{{- $kb := div $bytes 1024 -}}
|
||||||
|
{{- $mb := div $kb 1024 -}}
|
||||||
|
{{- if ge $mb 1 -}}{{- $mb -}} MB
|
||||||
|
{{- else if ge $kb 1 -}}{{- $kb -}} KB
|
||||||
|
{{- else -}}{{- $bytes -}} B{{- end -}}
|
||||||
+15
-16
@@ -1,27 +1,26 @@
|
|||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<title>{{ if .IsHome }}{{ .Site.Title }}{{ else }}{{ .Title }} - {{ .Site.Title }}{{ end }}</title>
|
||||||
<meta name="description" content="{{ .Page.Params.description }}">
|
<meta name="description" content="{{ .Page.Params.description }}">
|
||||||
<meta name="author" content="{{ .Site.Params.author }}">
|
<meta name="author" content="{{ or .Page.Params.author .Site.Params.author }}">
|
||||||
<meta name="generator" content="{{ hugo.Environment }}">
|
<meta name="generator" content="gohugo.io; {{ hugo.Environment }}">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<link rel="icon" type="image/png" href="/img/favicon.png">
|
<link rel="icon" type="image/png" href="/img/favicon.png">
|
||||||
|
|
||||||
<title>{{ if .IsHome }}{{ .Site.Title }}{{ else }}{{ .Title }} - {{ .Site.Title }}{{ end }}</title>
|
|
||||||
|
|
||||||
<!-- Compile SCSS to CSS -->
|
<!-- Compile SCSS to CSS -->
|
||||||
{{ with resources.Get "scss/main.scss" }}
|
{{- with resources.Get "scss/main.scss" -}}
|
||||||
{{ $opts := dict
|
{{- $opts := dict
|
||||||
"enableSourceMap" (not hugo.IsProduction)
|
"enableSourceMap" (not hugo.IsProduction)
|
||||||
"outputStyle" (cond hugo.IsProduction "compressed" "expanded")
|
"outputStyle" (cond hugo.IsProduction "compressed" "expanded")
|
||||||
"targetPath" "css/main.css"
|
"targetPath" "css/main.css"
|
||||||
"transpiler" "dartsass"
|
"transpiler" "dartsass"
|
||||||
}}
|
-}}
|
||||||
{{ with . | toCSS $opts }}
|
{{- with . | toCSS $opts -}}
|
||||||
{{ if hugo.IsProduction }}
|
{{- if hugo.IsProduction -}}
|
||||||
{{ with . | fingerprint "sha512" }}
|
{{- with . | fingerprint "sha512" -}}
|
||||||
<link rel="stylesheet" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
|
<link rel="stylesheet" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
|
||||||
{{ end }}
|
{{- end -}}
|
||||||
{{ else }}
|
{{- else -}}
|
||||||
<link rel="stylesheet" href="{{ .RelPermalink }}">
|
<link rel="stylesheet" href="{{ .RelPermalink }}">
|
||||||
{{ end }}
|
{{- end -}}
|
||||||
{{ end }}
|
{{- end -}}
|
||||||
{{ end }}
|
{{- end -}}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
<head>
|
<head>
|
||||||
{{- partial "meta.html" . -}}
|
{{- partial "meta.html" . -}}
|
||||||
{{- partial "head_extra.html" . -}}
|
{{- partial "head_extra.html" . -}}
|
||||||
|
{{- block "extra_head" . }}{{ end }}
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
{{- partial "header.html" . -}}
|
{{- partial "header.html" . -}}
|
||||||
|
|||||||
Reference in New Issue
Block a user