Author SHA1 Message Date
bbaovanc c23b43342c WIP: finished implementation of Netlify _redirects
TBD will be caddy, not sure whether this is actually a good idea because
including a Caddy file directly from GitHub Actions accessible job
output might be a config injection risk.
2026-07-08 02:18:53 -05:00
bbaovanc 2f6db565a9 WIP: Add redirects in Netlify _redirects style using old guide
Uses this guide: https://honnef.co/articles/generating-netlify-_redirects-from-hugo/

I didn't realize until after doing all this that there's a guide for the
same thing in the official Hugo docs, so I'm about to migrate over to
that.
2026-07-08 01:51:20 -05:00
5 changed files with 39 additions and 8 deletions
+17
View File
@@ -21,6 +21,23 @@ taxonomies:
outputs:
page:
- html
home:
- html
- rss
- redirects
outputFormats:
# https://honnef.co/articles/generating-netlify-_redirects-from-hugo/
redirects:
baseName: _redirects
isPlainText: true
mediaType: text/redirects
root: true
mediaTypes:
# https://honnef.co/articles/generating-netlify-_redirects-from-hugo/
text/redirects:
delimeter: ""
privacy:
googleAnalytics:
+12 -5
View File
@@ -68,12 +68,19 @@
>
</script>
{{ with resources.Get "css/search.css" | fingerprint "sha512" }}
<link rel="stylesheet" type="text/css" href="{{ .Permalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
{{ end }}
{{ if eq .Layout "search" }}
{{ with resources.Get "css/search.css" | fingerprint "sha512" }}
<link rel="stylesheet" type="text/css" href="{{ .Permalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
{{ end }}
<link rel="stylesheet" type="text/css" href="{{ absURL "pagefind/pagefind-component-ui.css" }}" crossorigin="anonymous">
<script src="{{ absURL "pagefind/pagefind-component-ui.js" }}" type="module" crossorigin="anonymous"></script>
<link rel="stylesheet" type="text/css" href="{{ absURL "pagefind/pagefind-ui.css" }}" crossorigin="anonymous">
<script src="{{ absURL "pagefind/pagefind-ui.js" }}" crossorigin="anonymous"></script>
<script>
window.addEventListener('DOMContentLoaded', (event) => {
new PagefindUI({ element: "#search-box", showSubResults: true });
});
</script>
{{ end }}
{{ with .Site.Params.faviconSVG }}
<link rel="icon" href="{{ . | absURL }}" />
-3
View File
@@ -5,9 +5,6 @@
</a>
</div>
<pagefind-modal-trigger></pagefind-modal-trigger>
<pagefind-modal></pagefind-modal>
<nav class="top-navbar" aria-label="{{ i18n "aria_navbar" }}">
{{ with .Site.Home }}
<a class="top-navbar-item{{ if $.IsHome }} top-navbar-item--active{{ end }}" href="{{ .Permalink | absLangURL }}">{{ .Title | markdownify }}</a>
+7
View File
@@ -0,0 +1,7 @@
{{ range hugo.Sites -}}
{{ range $p := .Pages -}}
{{ range .Aliases -}}
{{ . }} {{ $p.RelPermalink }}
{{ end -}}
{{ end -}}
{{ end -}}
+3
View File
@@ -0,0 +1,3 @@
{{ define "main" }}
<div id="search-box"></div>
{{ end }}