mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-18 21:11:19 +02:00
all: Run modernize -fix ./...
This commit is contained in:
@@ -56,7 +56,7 @@ func New(baseURL *url.URL) transform.Transformer {
|
||||
src += "&port=" + baseURL.Port()
|
||||
src += "&path=" + strings.TrimPrefix(path+"/livereload", "/")
|
||||
|
||||
script := []byte(fmt.Sprintf(`<script src="%s" data-no-instant defer></script>`, html.EscapeString(src)))
|
||||
script := fmt.Appendf(nil, `<script src="%s" data-no-instant defer></script>`, html.EscapeString(src))
|
||||
|
||||
c := make([]byte, len(b)+len(script))
|
||||
copy(c, b[:idx])
|
||||
|
@@ -39,12 +39,12 @@ func HugoGenerator(ft transform.FromTo) error {
|
||||
}
|
||||
|
||||
head := "<head>"
|
||||
replace := []byte(fmt.Sprintf("%s\n\t%s", head, hugoGeneratorTag))
|
||||
replace := fmt.Appendf(nil, "%s\n\t%s", head, hugoGeneratorTag)
|
||||
newcontent := bytes.Replace(b, []byte(head), replace, 1)
|
||||
|
||||
if len(newcontent) == len(b) {
|
||||
head := "<HEAD>"
|
||||
replace := []byte(fmt.Sprintf("%s\n\t%s", head, hugoGeneratorTag))
|
||||
replace := fmt.Appendf(nil, "%s\n\t%s", head, hugoGeneratorTag)
|
||||
newcontent = bytes.Replace(b, []byte(head), replace, 1)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user