diff options
| author | Henrique Dias <hacdias@gmail.com> | 2023-11-10 14:23:27 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-11-10 05:23:27 -0800 |
| commit | bcddd3bbbea1a64a3fa9d71254f143246116b5b3 (patch) | |
| tree | 9954499e5a916a1b1a1b1f67d06656e832b4b871 /config_test.go | |
| parent | a068bd4dd4b5040bd7b8ac514b32d3141f882b8a (diff) | |
| download | sally-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 'config_test.go')
| -rw-r--r-- | config_test.go | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/config_test.go b/config_test.go index e7ac247..21e67ef 100644 --- a/config_test.go +++ b/config_test.go @@ -9,7 +9,7 @@ import ( ) func TestParse(t *testing.T) { - path, clean := TempFile(t, ` + path := TempFile(t, ` url: google.golang.org packages: @@ -19,7 +19,6 @@ packages: vcs: svn `) - defer clean() config, err := Parse(path) assert.NoError(t, err) @@ -33,7 +32,7 @@ packages: } func TestParsePackageLevelURL(t *testing.T) { - path, clean := TempFile(t, ` + path := TempFile(t, ` url: google.golang.org packages: @@ -42,7 +41,6 @@ packages: url: go.uber.org `) - defer clean() config, err := Parse(path) assert.NoError(t, err) @@ -65,7 +63,7 @@ func TestParseGodocServer(t *testing.T) { for _, tt := range tests { t.Run(tt.give, func(t *testing.T) { - path, clean := TempFile(t, fmt.Sprintf(` + path := TempFile(t, fmt.Sprintf(` godoc: host: %q url: google.golang.org @@ -73,7 +71,6 @@ packages: grpc: repo: github.com/grpc/grpc-go `, tt.give)) - defer clean() config, err := Parse(path) require.NoError(t, err) |