aboutsummaryrefslogtreecommitdiffhomepage
path: root/hugolib/site_test.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2024-02-07 10:30:32 +0100
committerBjørn Erik Pedersen <[email protected]>2024-02-07 21:37:04 +0100
commit676e6875dac391f1ec1f7369ed2d59439f434806 (patch)
treeaf689eec1f48d511169f8b07f4c65420c7479413 /hugolib/site_test.go
parent068ccde4c75d018b977f4169308b3c994c6f3031 (diff)
downloadhugo-676e6875dac391f1ec1f7369ed2d59439f434806.tar.gz
hugo-676e6875dac391f1ec1f7369ed2d59439f434806.zip
Make HTML behave exactly like other content formats (note)
Fixes #11999
Diffstat (limited to 'hugolib/site_test.go')
-rw-r--r--hugolib/site_test.go59
1 files changed, 0 insertions, 59 deletions
diff --git a/hugolib/site_test.go b/hugolib/site_test.go
index 967fb827d..63088ee88 100644
--- a/hugolib/site_test.go
+++ b/hugolib/site_test.go
@@ -32,11 +32,6 @@ import (
"github.com/gohugoio/hugo/resources/page"
)
-const (
- templateMissingFunc = "{{ .Title | funcdoesnotexists }}"
- templateWithURLAbs = "<a href=\"/foobar.jpg\">Going</a>"
-)
-
func TestDraftAndFutureRender(t *testing.T) {
t.Parallel()
c := qt.New(t)
@@ -577,60 +572,6 @@ func doTestSectionNaming(t *testing.T, canonify, uglify, pluralize bool) {
}
}
-func TestAbsURLify(t *testing.T) {
- t.Parallel()
- c := qt.New(t)
- sources := [][2]string{
- {filepath.FromSlash("sect/doc1.html"), "<!doctype html><html><head></head><body><a href=\"#frag1\">link</a></body></html>"},
- {filepath.FromSlash("blue/doc2.html"), "---\nf: t\n---\n<!doctype html><html><body>more content</body></html>"},
- }
- for _, baseURL := range []string{"http://auth/bub", "http://base", "//base"} {
- for _, canonify := range []bool{true, false} {
-
- cfg, fs := newTestCfg()
-
- cfg.Set("uglyURLs", true)
- cfg.Set("canonifyURLs", canonify)
- cfg.Set("baseURL", baseURL)
-
- configs, err := loadTestConfigFromProvider(cfg)
- c.Assert(err, qt.IsNil)
-
- for _, src := range sources {
- writeSource(t, fs, filepath.Join("content", src[0]), src[1])
- }
-
- writeSource(t, fs, filepath.Join("layouts", "blue/single.html"), templateWithURLAbs)
-
- s := buildSingleSite(t, deps.DepsCfg{Fs: fs, Configs: configs}, BuildCfg{})
- th := newTestHelper(s.conf, s.Fs, t)
-
- tests := []struct {
- file, expected string
- }{
- {"public/blue/doc2.html", "<a href=\"%s/foobar.jpg\">Going</a>"},
- {"public/sect/doc1.html", "<!doctype html><html><head></head><body><a href=\"#frag1\">link</a></body></html>"},
- }
-
- for _, test := range tests {
-
- expected := test.expected
-
- if strings.Contains(expected, "%s") {
- expected = fmt.Sprintf(expected, baseURL)
- }
-
- if !canonify {
- expected = strings.Replace(expected, baseURL, "", -1)
- }
-
- th.assertFileContent(test.file, expected)
-
- }
- }
- }
-}
-
var weightedPage1 = `+++
weight = "2"
title = "One"