9 Commits
Author SHA1 Message Date
danielandClaude Sonnet 5 55308f7703 Respect base URL for nav logo; prefer logo.svg over favicon.svg
Reference the navbar brand image through relURL so it resolves
correctly when the site is served from a non-root base URL. Use
static/img/logo.svg when present, falling back to img/favicon.svg.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-02 09:44:44 +02:00
danielandClaude Sonnet 5 fc8023961a Fall back to page or site Author param in footer copyright.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-08 13:40:30 +02:00
daniel d9febf84d8 Add scripts_extra.html dummy file. 2026-08-08 12:12:11 +02:00
daniel 6d3fb4613b Use 404.svg image if available. 2026-06-28 14:50:53 +02:00
daniel ba12b11f03 Add 404 page. 2026-06-28 14:08:17 +02:00
daniel b024424405 Add extra_head block. 2026-06-27 17:25:22 +02:00
daniel 0f3258f2db Remove whitespace in meta partial. 2026-06-24 16:10:29 +02:00
daniel 8d367dfa79 Add human file size partial. 2026-06-24 16:10:17 +02:00
daniel bf6ae71511 Ensure context in partial. 2026-06-16 20:54:02 +02:00
9 changed files with 95 additions and 25 deletions

No files matched your search

+12
View File
@@ -1,3 +1,15 @@
# hugo_bootstrap_theme
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.
+47
View File
@@ -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 }}
+1 -1
View File
@@ -2,7 +2,7 @@
<div class="container py-4">
<div class="row">
<div class="col-md-6">
<p>&copy; {{ now.Year }} {{ .Site.Title }}</p>
<p>&copy; {{ now.Year }} {{ or (or .Params.Author .Site.Params.Author) .Site.Title }}</p>
</div>
<div class="col-md-6 text-md-end">
<p>
+3 -1
View File
@@ -1,7 +1,9 @@
<nav class="navbar navbar-expand-lg navbar-light bg-light sticky-top">
<div class="container"> <!-- Changed from container-fluid to container -->
<a class="navbar-brand fw-bold" href="{{ .Site.BaseURL }}">
<img src="/img/favicon.svg" alt="{{ .Site.Title }}" title="{{ .Site.Title }}">
{{- $logo := "img/favicon.svg" -}}
{{- if os.FileExists "static/img/logo.svg" -}}{{- $logo = "img/logo.svg" -}}{{- end -}}
<img src="{{ $logo | relURL }}" alt="{{ .Site.Title }}" title="{{ .Site.Title }}">
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse"
+7
View File
@@ -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 -}}
+21 -22
View File
@@ -1,27 +1,26 @@
<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="author" content="{{ .Site.Params.author }}">
<meta name="generator" content="{{ hugo.Environment }}">
<meta name="author" content="{{ or .Page.Params.author .Site.Params.author }}">
<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">
<title>{{ if .IsHome }}{{ .Site.Title }}{{ else }}{{ .Title }} - {{ .Site.Title }}{{ end }}</title>
<!-- Compile SCSS to CSS -->
{{ with resources.Get "scss/main.scss" }}
{{ $opts := dict
"enableSourceMap" (not hugo.IsProduction)
"outputStyle" (cond hugo.IsProduction "compressed" "expanded")
"targetPath" "css/main.css"
"transpiler" "dartsass"
}}
{{ with . | toCSS $opts }}
{{ if hugo.IsProduction }}
{{ with . | fingerprint "sha512" }}
<link rel="stylesheet" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
{{ end }}
{{ else }}
<link rel="stylesheet" href="{{ .RelPermalink }}">
{{ end }}
{{ end }}
{{ end }}
{{- with resources.Get "scss/main.scss" -}}
{{- $opts := dict
"enableSourceMap" (not hugo.IsProduction)
"outputStyle" (cond hugo.IsProduction "compressed" "expanded")
"targetPath" "css/main.css"
"transpiler" "dartsass"
-}}
{{- with . | toCSS $opts -}}
{{- if hugo.IsProduction -}}
{{- with . | fingerprint "sha512" -}}
<link rel="stylesheet" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
{{- end -}}
{{- else -}}
<link rel="stylesheet" href="{{ .RelPermalink }}">
{{- end -}}
{{- end -}}
{{- end -}}
+1 -1
View File
@@ -11,4 +11,4 @@
<script src="{{ $custom.RelPermalink }}" integrity="{{ $custom.Data.Integrity }}" crossorigin="anonymous"></script>
{{ end }}
{{ partial "scripts_extra.html "}}
{{ partial "scripts_extra.html" . }}
+2
View File
@@ -0,0 +1,2 @@
<!-- extra scripts may go here -->
+1
View File
@@ -3,6 +3,7 @@
<head>
{{- partial "meta.html" . -}}
{{- partial "head_extra.html" . -}}
{{- block "extra_head" . }}{{ end }}
</head>
<body>
{{- partial "header.html" . -}}