Don't use self-closing generator tag - hugo - [fork] hugo port for 9front
HTML git clone git@git.drkhsh.at/hugo.git
DIR Log
DIR Files
DIR Refs
DIR Submodules
DIR README
DIR LICENSE
---
DIR commit 01ebb6e304b243c335470f737cf7ad8b9d70bac9
DIR parent a066e98851dfbd78c17c98f0878c2e8b84a10f50
HTML Author: JB <djibe89@hotmail.com>
Date: Fri, 14 Oct 2022 12:16:53 +0200
Don't use self-closing generator tag
Diffstat:
M common/hugo/hugo.go | 2 +-
M docs/content/en/functions/hugo.md | 2 +-
M transform/metainject/hugogenerator… | 2 +-
M transform/metainject/hugogenerator… | 8 ++++----
4 files changed, 7 insertions(+), 7 deletions(-)
---
DIR diff --git 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 {
DIR diff --git 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`
DIR diff --git 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.
DIR diff --git 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"},