Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJB <djibe89@hotmail.com>2022-10-14 13:16:53 +0300
committerGitHub <noreply@github.com>2022-10-14 13:16:53 +0300
commit01ebb6e304b243c335470f737cf7ad8b9d70bac9 (patch)
tree843d0b4b0500d03a4d05b9917aa9b1e48fb92705
parenta066e98851dfbd78c17c98f0878c2e8b84a10f50 (diff)
Don't use self-closing generator tag
-rw-r--r--common/hugo/hugo.go2
-rw-r--r--docs/content/en/functions/hugo.md2
-rw-r--r--transform/metainject/hugogenerator.go2
-rw-r--r--transform/metainject/hugogenerator_test.go8
4 files changed, 7 insertions, 7 deletions
diff --git a/common/hugo/hugo.go b/common/hugo/hugo.go
index 54fbd65a3..5f51d2be2 100644
--- a/common/hugo/hugo.go
+++ b/common/hugo/hugo.go
@@ -68,7 +68,7 @@ func (i Info) Version() VersionString {
// Generator a Hugo meta generator HTML tag.
func (i Info) Generator() template.HTML {
- return template.HTML(fmt.Sprintf(`<meta name="generator" content="Hugo %s" />`, CurrentVersion.String()))
+ return template.HTML(fmt.Sprintf(`<meta name="generator" content="Hugo %s">`, CurrentVersion.String()))
}
func (i Info) IsProduction() bool {
diff --git a/docs/content/en/functions/hugo.md b/docs/content/en/functions/hugo.md
index 1792f5a8d..40a003629 100644
--- a/docs/content/en/functions/hugo.md
+++ b/docs/content/en/functions/hugo.md
@@ -22,7 +22,7 @@ aliases: []
`hugo` returns an instance that contains the following functions:
hugo.Generator
-: `<meta>` tag for the version of Hugo that generated the site. `hugo.Generator` outputs a *complete* HTML tag; e.g. `<meta name="generator" content="Hugo 0.63.2" />`
+: `<meta>` tag for the version of Hugo that generated the site. `hugo.Generator` outputs a *complete* HTML tag; e.g. `<meta name="generator" content="Hugo 0.63.2">`
hugo.Version
: the current version of the Hugo binary you are using e.g. `0.63.2`
diff --git a/transform/metainject/hugogenerator.go b/transform/metainject/hugogenerator.go
index 20f05145b..fd3a6a4ab 100644
--- a/transform/metainject/hugogenerator.go
+++ b/transform/metainject/hugogenerator.go
@@ -25,7 +25,7 @@ import (
var (
metaTagsCheck = regexp.MustCompile(`(?i)<meta\s+name=['|"]?generator['|"]?`)
- hugoGeneratorTag = fmt.Sprintf(`<meta name="generator" content="Hugo %s" />`, hugo.CurrentVersion)
+ hugoGeneratorTag = fmt.Sprintf(`<meta name="generator" content="Hugo %s">`, hugo.CurrentVersion)
)
// HugoGenerator injects a meta generator tag for Hugo if none present.
diff --git a/transform/metainject/hugogenerator_test.go b/transform/metainject/hugogenerator_test.go
index 1d6d7c4b9..415da61b3 100644
--- a/transform/metainject/hugogenerator_test.go
+++ b/transform/metainject/hugogenerator_test.go
@@ -39,10 +39,10 @@ func TestHugoGeneratorInject(t *testing.T) {
META
<foo />
</HEAD>`},
- {`<head><meta name="generator" content="Jekyll" /></head>`, `<head><meta name="generator" content="Jekyll" /></head>`},
- {`<head><meta name='generator' content='Jekyll' /></head>`, `<head><meta name='generator' content='Jekyll' /></head>`},
- {`<head><meta name=generator content=Jekyll /></head>`, `<head><meta name=generator content=Jekyll /></head>`},
- {`<head><META NAME="GENERATOR" content="Jekyll" /></head>`, `<head><META NAME="GENERATOR" content="Jekyll" /></head>`},
+ {`<head><meta name="generator" content="Jekyll"></head>`, `<head><meta name="generator" content="Jekyll"></head>`},
+ {`<head><meta name='generator' content='Jekyll'></head>`, `<head><meta name='generator' content='Jekyll'></head>`},
+ {`<head><meta name=generator content=Jekyll></head>`, `<head><meta name=generator content=Jekyll></head>`},
+ {`<head><META NAME="GENERATOR" content="Jekyll"></head>`, `<head><META NAME="GENERATOR" content="Jekyll"></head>`},
{"", ""},
{"</head>", "</head>"},
{"<head>", "<head>\n\tMETA"},