aboutsummaryrefslogtreecommitdiff
path: root/templates/templates.go
diff options
context:
space:
mode:
authorHenrique Dias <hacdias@gmail.com>2023-11-10 14:23:27 +0100
committerGitHub <noreply@github.com>2023-11-10 05:23:27 -0800
commitbcddd3bbbea1a64a3fa9d71254f143246116b5b3 (patch)
tree9954499e5a916a1b1a1b1f67d06656e832b4b871 /templates/templates.go
parenta068bd4dd4b5040bd7b8ac514b32d3141f882b8a (diff)
downloadsally-bcddd3bbbea1a64a3fa9d71254f143246116b5b3.tar.gz
feat: support for custom templates (#129)
Adds a `-templates` flag that can be used to provide an alternative directory with templates for Sally to use. The new templates override the default set embedded in Sally. This includes a new 404 template so that 404 errors use the same theme as the rest of the website. Additionally, for HTTP status >400, this also sets the Cache-Control header to discourage CDNs like Cloudflare from caching the page. Resolves #125, #18
Diffstat (limited to 'templates/templates.go')
-rw-r--r--templates/templates.go15
1 files changed, 0 insertions, 15 deletions
diff --git a/templates/templates.go b/templates/templates.go
deleted file mode 100644
index 4217a5a..0000000
--- a/templates/templates.go
+++ /dev/null
@@ -1,15 +0,0 @@
-// Package templates exposes the template used by Sally
-// to render the HTML pages.
-package templates
-
-import _ "embed" // needed for go:embed
-
-// Index holds the contents of the index.html template.
-//
-//go:embed index.html
-var Index string
-
-// Package holds the contents of the package.html template.
-//
-//go:embed package.html
-var Package string