diff -Nru hugo-0.54.0/benchbep.sh hugo-0.55.1/benchbep.sh --- hugo-0.54.0/benchbep.sh 1970-01-01 00:00:00.000000000 +0000 +++ hugo-0.55.1/benchbep.sh 2019-04-12 09:56:13.000000000 +0000 @@ -0,0 +1,2 @@ +gobench -package=./hugolib -bench="BenchmarkSiteBuilding/YAML,num_langs=3,num_pages=5000,tags_per_page=5,shortcodes,render" -count=3 > 1.bench +benchcmp -best 0.bench 1.bench \ No newline at end of file diff -Nru hugo-0.54.0/cache/filecache/filecache_config.go hugo-0.55.1/cache/filecache/filecache_config.go --- hugo-0.54.0/cache/filecache/filecache_config.go 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/cache/filecache/filecache_config.go 2019-04-12 09:56:13.000000000 +0000 @@ -47,11 +47,11 @@ var defaultCacheConfigs = map[string]cacheConfig{ cacheKeyGetJSON: defaultCacheConfig, cacheKeyGetCSV: defaultCacheConfig, - cacheKeyImages: cacheConfig{ + cacheKeyImages: { MaxAge: -1, Dir: resourcesGenDir, }, - cacheKeyAssets: cacheConfig{ + cacheKeyAssets: { MaxAge: -1, Dir: resourcesGenDir, }, diff -Nru hugo-0.54.0/cache/filecache/filecache.go hugo-0.55.1/cache/filecache/filecache.go --- hugo-0.54.0/cache/filecache/filecache.go 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/cache/filecache/filecache.go 2019-04-12 09:56:13.000000000 +0000 @@ -274,7 +274,7 @@ if c.maxAge < 0 { return false } - return c.maxAge == 0 || time.Now().Sub(modTime) > c.maxAge + return c.maxAge == 0 || time.Since(modTime) > c.maxAge } // For testing diff -Nru hugo-0.54.0/.circleci/config.yml hugo-0.55.1/.circleci/config.yml --- hugo-0.54.0/.circleci/config.yml 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/.circleci/config.yml 2019-04-12 09:56:13.000000000 +0000 @@ -1,6 +1,6 @@ defaults: &defaults docker: - - image: bepsays/ci-goreleaser:1.11-5 + - image: bepsays/ci-goreleaser:1.12-2 environment: CGO_ENABLED: "0" diff -Nru hugo-0.54.0/codegen/methods2_test.go hugo-0.55.1/codegen/methods2_test.go --- hugo-0.54.0/codegen/methods2_test.go 1970-01-01 00:00:00.000000000 +0000 +++ hugo-0.55.1/codegen/methods2_test.go 2019-04-12 09:56:13.000000000 +0000 @@ -0,0 +1,20 @@ +// Copyright 2019 The Hugo Authors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package codegen + +type IEmbed interface { + MethodEmbed3(s string) string + MethodEmbed1() string + MethodEmbed2() +} diff -Nru hugo-0.54.0/codegen/methods.go hugo-0.55.1/codegen/methods.go --- hugo-0.54.0/codegen/methods.go 1970-01-01 00:00:00.000000000 +0000 +++ hugo-0.55.1/codegen/methods.go 2019-04-12 09:56:13.000000000 +0000 @@ -0,0 +1,548 @@ +// Copyright 2019 The Hugo Authors. All rights reserved. +// Some functions in this file (see comments) is based on the Go source code, +// copyright The Go Authors and governed by a BSD-style license. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Package codegen contains helpers for code generation. +package codegen + +import ( + "fmt" + "go/ast" + "go/parser" + "go/token" + "os" + "path" + "path/filepath" + "reflect" + "regexp" + "sort" + "strings" + "sync" +) + +// Make room for insertions +const weightWidth = 1000 + +// NewInspector creates a new Inspector given a source root. +func NewInspector(root string) *Inspector { + return &Inspector{ProjectRootDir: root} +} + +// Inspector provides methods to help code generation. It uses a combination +// of reflection and source code AST to do the heavy lifting. +type Inspector struct { + ProjectRootDir string + + init sync.Once + + // Determines method order. Go's reflect sorts lexicographically, so + // we must parse the source to preserve this order. + methodWeight map[string]map[string]int +} + +// MethodsFromTypes create a method set from the include slice, excluding any +// method in exclude. +func (c *Inspector) MethodsFromTypes(include []reflect.Type, exclude []reflect.Type) Methods { + c.parseSource() + + var methods Methods + + var excludes = make(map[string]bool) + + if len(exclude) > 0 { + for _, m := range c.MethodsFromTypes(exclude, nil) { + excludes[m.Name] = true + } + } + + // There may be overlapping interfaces in types. Do a simple check for now. + seen := make(map[string]bool) + + nameAndPackage := func(t reflect.Type) (string, string) { + var name, pkg string + + isPointer := t.Kind() == reflect.Ptr + + if isPointer { + t = t.Elem() + } + + pkgPrefix := "" + if pkgPath := t.PkgPath(); pkgPath != "" { + pkgPath = strings.TrimSuffix(pkgPath, "/") + _, shortPath := path.Split(pkgPath) + pkgPrefix = shortPath + "." + pkg = pkgPath + } + + name = t.Name() + if name == "" { + // interface{} + name = t.String() + } + + if isPointer { + pkgPrefix = "*" + pkgPrefix + } + + name = pkgPrefix + name + + return name, pkg + + } + + for _, t := range include { + + for i := 0; i < t.NumMethod(); i++ { + + m := t.Method(i) + if excludes[m.Name] || seen[m.Name] { + continue + } + + seen[m.Name] = true + + if m.PkgPath != "" { + // Not exported + continue + } + + numIn := m.Type.NumIn() + + ownerName, _ := nameAndPackage(t) + + method := Method{Owner: t, OwnerName: ownerName, Name: m.Name} + + for i := 0; i < numIn; i++ { + in := m.Type.In(i) + + name, pkg := nameAndPackage(in) + + if pkg != "" { + method.Imports = append(method.Imports, pkg) + } + + method.In = append(method.In, name) + } + + numOut := m.Type.NumOut() + + if numOut > 0 { + for i := 0; i < numOut; i++ { + out := m.Type.Out(i) + name, pkg := nameAndPackage(out) + + if pkg != "" { + method.Imports = append(method.Imports, pkg) + } + + method.Out = append(method.Out, name) + } + } + + methods = append(methods, method) + } + + } + + sort.SliceStable(methods, func(i, j int) bool { + mi, mj := methods[i], methods[j] + + wi := c.methodWeight[mi.OwnerName][mi.Name] + wj := c.methodWeight[mj.OwnerName][mj.Name] + + if wi == wj { + return mi.Name < mj.Name + } + + return wi < wj + + }) + + return methods + +} + +func (c *Inspector) parseSource() { + c.init.Do(func() { + + if !strings.Contains(c.ProjectRootDir, "hugo") { + panic("dir must be set to the Hugo root") + } + + c.methodWeight = make(map[string]map[string]int) + dirExcludes := regexp.MustCompile("docs|examples") + fileExcludes := regexp.MustCompile("autogen") + var filenames []string + + filepath.Walk(c.ProjectRootDir, func(path string, info os.FileInfo, err error) error { + if info.IsDir() { + if dirExcludes.MatchString(info.Name()) { + return filepath.SkipDir + } + } + + if !strings.HasSuffix(path, ".go") || fileExcludes.MatchString(path) { + return nil + } + + filenames = append(filenames, path) + + return nil + + }) + + for _, filename := range filenames { + + pkg := c.packageFromPath(filename) + + fset := token.NewFileSet() + node, err := parser.ParseFile(fset, filename, nil, parser.ParseComments) + if err != nil { + panic(err) + } + + ast.Inspect(node, func(n ast.Node) bool { + switch t := n.(type) { + case *ast.TypeSpec: + if t.Name.IsExported() { + switch it := t.Type.(type) { + case *ast.InterfaceType: + iface := pkg + "." + t.Name.Name + methodNames := collectMethodsRecursive(pkg, it.Methods.List) + weights := make(map[string]int) + weight := weightWidth + for _, name := range methodNames { + weights[name] = weight + weight += weightWidth + } + c.methodWeight[iface] = weights + } + } + + } + return true + }) + + } + + // Complement + for _, v1 := range c.methodWeight { + for k2, w := range v1 { + if v, found := c.methodWeight[k2]; found { + for k3, v3 := range v { + v1[k3] = (v3 / weightWidth) + w + } + } + } + } + + }) +} + +func (c *Inspector) packageFromPath(p string) string { + p = filepath.ToSlash(p) + base := path.Base(p) + if !strings.Contains(base, ".") { + return base + } + return path.Base(strings.TrimSuffix(p, base)) +} + +// Method holds enough information about it to recreate it. +type Method struct { + // The interface we extracted this method from. + Owner reflect.Type + + // String version of the above, on the form PACKAGE.NAME, e.g. + // page.Page + OwnerName string + + // Method name. + Name string + + // Imports needed to satisfy the method signature. + Imports []string + + // Argument types, including any package prefix, e.g. string, int, interface{}, + // net.Url + In []string + + // Return types. + Out []string +} + +// Declaration creates a method declaration (without any body) for the given receiver. +func (m Method) Declaration(receiver string) string { + return fmt.Sprintf("func (%s %s) %s%s %s", receiverShort(receiver), receiver, m.Name, m.inStr(), m.outStr()) +} + +// DeclarationNamed creates a method declaration (without any body) for the given receiver +// with named return values. +func (m Method) DeclarationNamed(receiver string) string { + return fmt.Sprintf("func (%s %s) %s%s %s", receiverShort(receiver), receiver, m.Name, m.inStr(), m.outStrNamed()) +} + +// Delegate creates a delegate call string. +func (m Method) Delegate(receiver, delegate string) string { + ret := "" + if len(m.Out) > 0 { + ret = "return " + } + return fmt.Sprintf("%s%s.%s.%s%s", ret, receiverShort(receiver), delegate, m.Name, m.inOutStr()) +} + +func (m Method) String() string { + return m.Name + m.inStr() + " " + m.outStr() + "\n" +} + +func (m Method) inOutStr() string { + if len(m.In) == 0 { + return "()" + } + + args := make([]string, len(m.In)) + for i := 0; i < len(args); i++ { + args[i] = fmt.Sprintf("arg%d", i) + } + return "(" + strings.Join(args, ", ") + ")" +} + +func (m Method) inStr() string { + if len(m.In) == 0 { + return "()" + } + + args := make([]string, len(m.In)) + for i := 0; i < len(args); i++ { + args[i] = fmt.Sprintf("arg%d %s", i, m.In[i]) + } + return "(" + strings.Join(args, ", ") + ")" +} + +func (m Method) outStr() string { + if len(m.Out) == 0 { + return "" + } + if len(m.Out) == 1 { + return m.Out[0] + } + + return "(" + strings.Join(m.Out, ", ") + ")" +} + +func (m Method) outStrNamed() string { + if len(m.Out) == 0 { + return "" + } + + outs := make([]string, len(m.Out)) + for i := 0; i < len(outs); i++ { + outs[i] = fmt.Sprintf("o%d %s", i, m.Out[i]) + } + + return "(" + strings.Join(outs, ", ") + ")" +} + +// Methods represents a list of methods for one or more interfaces. +// The order matches the defined order in their source file(s). +type Methods []Method + +// Imports returns a sorted list of package imports needed to satisfy the +// signatures of all methods. +func (m Methods) Imports() []string { + var pkgImports []string + for _, method := range m { + pkgImports = append(pkgImports, method.Imports...) + } + if len(pkgImports) > 0 { + pkgImports = uniqueNonEmptyStrings(pkgImports) + sort.Strings(pkgImports) + } + return pkgImports +} + +// ToMarshalJSON creates a MarshalJSON method for these methods. Any method name +// matchin any of the regexps in excludes will be ignored. +func (m Methods) ToMarshalJSON(receiver, pkgPath string, excludes ...string) (string, []string) { + var sb strings.Builder + + r := receiverShort(receiver) + what := firstToUpper(trimAsterisk(receiver)) + pgkName := path.Base(pkgPath) + + fmt.Fprintf(&sb, "func Marshal%sToJSON(%s %s) ([]byte, error) {\n", what, r, receiver) + + var methods Methods + var excludeRes = make([]*regexp.Regexp, len(excludes)) + + for i, exclude := range excludes { + excludeRes[i] = regexp.MustCompile(exclude) + } + + for _, method := range m { + // Exclude methods with arguments and incompatible return values + if len(method.In) > 0 || len(method.Out) == 0 || len(method.Out) > 2 { + continue + } + + if len(method.Out) == 2 { + if method.Out[1] != "error" { + continue + } + } + + for _, re := range excludeRes { + if re.MatchString(method.Name) { + continue + } + } + + methods = append(methods, method) + } + + for _, method := range methods { + varn := varName(method.Name) + if len(method.Out) == 1 { + fmt.Fprintf(&sb, "\t%s := %s.%s()\n", varn, r, method.Name) + } else { + fmt.Fprintf(&sb, "\t%s, err := %s.%s()\n", varn, r, method.Name) + fmt.Fprint(&sb, "\tif err != nil {\n\t\treturn nil, err\n\t}\n") + } + } + + fmt.Fprint(&sb, "\n\ts := struct {\n") + + for _, method := range methods { + fmt.Fprintf(&sb, "\t\t%s %s\n", method.Name, typeName(method.Out[0], pgkName)) + } + + fmt.Fprint(&sb, "\n\t}{\n") + + for _, method := range methods { + varn := varName(method.Name) + fmt.Fprintf(&sb, "\t\t%s: %s,\n", method.Name, varn) + } + + fmt.Fprint(&sb, "\n\t}\n\n") + fmt.Fprint(&sb, "\treturn json.Marshal(&s)\n}") + + pkgImports := append(methods.Imports(), "encoding/json") + + if pkgPath != "" { + // Exclude self + for i, pkgImp := range pkgImports { + if pkgImp == pkgPath { + pkgImports = append(pkgImports[:i], pkgImports[i+1:]...) + } + } + } + + return sb.String(), pkgImports + +} + +func collectMethodsRecursive(pkg string, f []*ast.Field) []string { + var methodNames []string + for _, m := range f { + if m.Names != nil { + methodNames = append(methodNames, m.Names[0].Name) + continue + } + + if ident, ok := m.Type.(*ast.Ident); ok && ident.Obj != nil { + // Embedded interface + methodNames = append( + methodNames, + collectMethodsRecursive( + pkg, + ident.Obj.Decl.(*ast.TypeSpec).Type.(*ast.InterfaceType).Methods.List)...) + } else { + // Embedded, but in a different file/package. Return the + // package.Name and deal with that later. + name := packageName(m.Type) + if !strings.Contains(name, ".") { + // Assume current package + name = pkg + "." + name + } + methodNames = append(methodNames, name) + } + } + + return methodNames + +} + +func firstToLower(name string) string { + return strings.ToLower(name[:1]) + name[1:] +} + +func firstToUpper(name string) string { + return strings.ToUpper(name[:1]) + name[1:] +} + +func packageName(e ast.Expr) string { + switch tp := e.(type) { + case *ast.Ident: + return tp.Name + case *ast.SelectorExpr: + return fmt.Sprintf("%s.%s", packageName(tp.X), packageName(tp.Sel)) + } + return "" +} + +func receiverShort(receiver string) string { + return strings.ToLower(trimAsterisk(receiver))[:1] +} + +func trimAsterisk(name string) string { + return strings.TrimPrefix(name, "*") +} + +func typeName(name, pkg string) string { + return strings.TrimPrefix(name, pkg+".") +} + +func uniqueNonEmptyStrings(s []string) []string { + var unique []string + set := map[string]interface{}{} + for _, val := range s { + if val == "" { + continue + } + if _, ok := set[val]; !ok { + unique = append(unique, val) + set[val] = val + } + } + return unique +} + +func varName(name string) string { + name = firstToLower(name) + + // Adjust some reserved keywords, see https://golang.org/ref/spec#Keywords + switch name { + case "type": + name = "typ" + case "package": + name = "pkg" + // Not reserved, but syntax highlighters has it as a keyword. + case "len": + name = "length" + } + + return name + +} diff -Nru hugo-0.54.0/codegen/methods_test.go hugo-0.55.1/codegen/methods_test.go --- hugo-0.54.0/codegen/methods_test.go 1970-01-01 00:00:00.000000000 +0000 +++ hugo-0.55.1/codegen/methods_test.go 2019-04-12 09:56:13.000000000 +0000 @@ -0,0 +1,100 @@ +// Copyright 2019 The Hugo Authors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package codegen + +import ( + "fmt" + "net" + "os" + "reflect" + "testing" + + "github.com/gohugoio/hugo/common/herrors" + "github.com/stretchr/testify/require" +) + +func TestMethods(t *testing.T) { + + var ( + zeroIE = reflect.TypeOf((*IEmbed)(nil)).Elem() + zeroIEOnly = reflect.TypeOf((*IEOnly)(nil)).Elem() + zeroI = reflect.TypeOf((*I)(nil)).Elem() + ) + + dir, _ := os.Getwd() + c := NewInspector(dir) + + t.Run("MethodsFromTypes", func(t *testing.T) { + assert := require.New(t) + + methods := c.MethodsFromTypes([]reflect.Type{zeroI}, nil) + + methodsStr := fmt.Sprint(methods) + + assert.Contains(methodsStr, "Method1(arg0 herrors.ErrorContext)") + assert.Contains(methodsStr, "Method7() interface {}") + assert.Contains(methodsStr, "Method0() string\n Method4() string") + assert.Contains(methodsStr, "MethodEmbed3(arg0 string) string\n MethodEmbed1() string") + + assert.Contains(methods.Imports(), "github.com/gohugoio/hugo/common/herrors") + }) + + t.Run("EmbedOnly", func(t *testing.T) { + assert := require.New(t) + + methods := c.MethodsFromTypes([]reflect.Type{zeroIEOnly}, nil) + + methodsStr := fmt.Sprint(methods) + + assert.Contains(methodsStr, "MethodEmbed3(arg0 string) string") + + }) + + t.Run("ToMarshalJSON", func(t *testing.T) { + assert := require.New(t) + + m, pkg := c.MethodsFromTypes( + []reflect.Type{zeroI}, + []reflect.Type{zeroIE}).ToMarshalJSON("*page", "page") + + assert.Contains(m, "method6 := p.Method6()") + assert.Contains(m, "Method0: method0,") + assert.Contains(m, "return json.Marshal(&s)") + + assert.Contains(pkg, "github.com/gohugoio/hugo/common/herrors") + assert.Contains(pkg, "encoding/json") + + fmt.Println(pkg) + + }) + +} + +type I interface { + IEmbed + Method0() string + Method4() string + Method1(myerr herrors.ErrorContext) + Method3(myint int, mystring string) + Method5() (string, error) + Method6() *net.IP + Method7() interface{} + Method8() herrors.ErrorContext + method2() + method9() os.FileInfo +} + +type IEOnly interface { + IEmbed +} diff -Nru hugo-0.54.0/commands/commandeer.go hugo-0.55.1/commands/commandeer.go --- hugo-0.54.0/commands/commandeer.go 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/commands/commandeer.go 2019-04-12 09:56:13.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright 2018 The Hugo Authors. All rights reserved. +// Copyright 2019 The Hugo Authors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -143,7 +143,7 @@ // The time value used is tested with mass content replacements in a fairly big Hugo site. // It is better to wait for some seconds in those cases rather than get flooded // with rebuilds. - rebuildDebouncer, _, _ = debounce.New(4 * time.Second) + rebuildDebouncer = debounce.New(4 * time.Second) } c := &commandeer{ @@ -304,7 +304,7 @@ } // Set some commonly used flags - c.doLiveReload = !c.h.buildWatch && !c.Cfg.GetBool("disableLiveReload") + c.doLiveReload = running && !c.Cfg.GetBool("disableLiveReload") c.fastRenderMode = c.doLiveReload && !c.Cfg.GetBool("disableFastRender") c.showErrorInBrowser = c.doLiveReload && !c.Cfg.GetBool("disableBrowserError") @@ -351,11 +351,19 @@ // to make that decision. irrelevantRe: regexp.MustCompile(`\.map$`), } + changeDetector.PrepareNew() fs.Destination = hugofs.NewHashingFs(fs.Destination, changeDetector) c.changeDetector = changeDetector } + if c.Cfg.GetBool("logPathWarnings") { + fs.Destination = hugofs.NewCreateCountingFs(fs.Destination) + } + + // To debug hard-to-find path issues. + //fs.Destination = hugofs.NewStacktracerFs(fs.Destination, `fr/fr`) + err = c.initFs(fs) if err != nil { return diff -Nru hugo-0.54.0/commands/commands.go hugo-0.55.1/commands/commands.go --- hugo-0.54.0/commands/commands.go 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/commands/commands.go 2019-04-12 09:56:13.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright 2017 The Hugo Authors. All rights reserved. +// Copyright 2019 The Hugo Authors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -23,7 +23,6 @@ "github.com/gohugoio/hugo/config" "github.com/gohugoio/hugo/helpers" "github.com/spf13/cobra" - "github.com/spf13/nitro" ) type commandsBuilder struct { @@ -197,6 +196,12 @@ gc bool + // Profile flags (for debugging of performance problems) + cpuprofile string + memprofile string + mutexprofile string + traceprofile string + // TODO(bep) var vs string logging bool verbose bool @@ -255,13 +260,22 @@ cmd.Flags().Bool("enableGitInfo", false, "add Git revision, date and author info to the pages") cmd.Flags().BoolVar(&cc.gc, "gc", false, "enable to run some cleanup tasks (remove unused cache files) after the build") - cmd.Flags().BoolVar(&nitro.AnalysisOn, "stepAnalysis", false, "display memory and timing of different steps of the program") cmd.Flags().Bool("templateMetrics", false, "display metrics about template executions") cmd.Flags().Bool("templateMetricsHints", false, "calculate some improvement hints when combined with --templateMetrics") cmd.Flags().BoolP("forceSyncStatic", "", false, "copy all files when static is changed.") cmd.Flags().BoolP("noTimes", "", false, "don't sync modification time of files") cmd.Flags().BoolP("noChmod", "", false, "don't sync permission mode of files") cmd.Flags().BoolP("i18n-warnings", "", false, "print missing translations") + cmd.Flags().BoolP("path-warnings", "", false, "print warnings on duplicate target paths etc.") + cmd.Flags().StringVarP(&cc.cpuprofile, "profile-cpu", "", "", "write cpu profile to `file`") + cmd.Flags().StringVarP(&cc.memprofile, "profile-mem", "", "", "write memory profile to `file`") + cmd.Flags().StringVarP(&cc.mutexprofile, "profile-mutex", "", "", "write Mutex profile to `file`") + cmd.Flags().StringVarP(&cc.traceprofile, "trace", "", "", "write trace to `file` (not useful in general)") + + // Hide these for now. + cmd.Flags().MarkHidden("profile-cpu") + cmd.Flags().MarkHidden("profile-mem") + cmd.Flags().MarkHidden("profile-mutex") cmd.Flags().StringSlice("disableKinds", []string{}, "disable different kind of pages (home, RSS etc.)") diff -Nru hugo-0.54.0/commands/commands_test.go hugo-0.55.1/commands/commands_test.go --- hugo-0.54.0/commands/commands_test.go 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/commands/commands_test.go 2019-04-12 09:56:13.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright 2018 The Hugo Authors. All rights reserved. +// Copyright 2019 The Hugo Authors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,6 +20,8 @@ "path/filepath" "testing" + "github.com/gohugoio/hugo/common/types" + "github.com/spf13/cobra" "github.com/spf13/viper" @@ -41,7 +43,7 @@ assert.NoError(resp.Err) result := resp.Result assert.True(len(result.Sites) == 1) - assert.True(len(result.Sites[0].RegularPages) == 1) + assert.True(len(result.Sites[0].RegularPages()) == 1) } func TestCommandsPersistentFlags(t *testing.T) { @@ -75,6 +77,7 @@ "--port=1366", "--renderToDisk", "--source=mysource", + "--path-warnings", }, func(commands []cmder) { var sc *serverCmd for _, command := range commands { @@ -112,6 +115,9 @@ assert.True(cfg.GetBool("gc")) + // The flag is named path-warnings + assert.True(cfg.GetBool("logPathWarnings")) + // The flag is named i18n-warnings assert.True(cfg.GetBool("logI18nWarnings")) @@ -183,8 +189,8 @@ } for _, test := range tests { - - hugoCmd := newCommandsBuilder().addAll().build().getCommand() + b := newCommandsBuilder().addAll().build() + hugoCmd := b.getCommand() test.flags = append(test.flags, "--quiet") hugoCmd.SetArgs(append(test.commands, test.flags...)) @@ -200,6 +206,13 @@ assert.NoError(err, fmt.Sprintf("%v", test.commands)) } + // Assert that we have not left any development debug artifacts in + // the code. + if b.c != nil { + _, ok := b.c.destinationFs.(types.DevMarker) + assert.False(ok) + } + } } diff -Nru hugo-0.54.0/commands/convert.go hugo-0.55.1/commands/convert.go --- hugo-0.54.0/commands/convert.go 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/commands/convert.go 2019-04-12 09:56:13.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright 2015 The Hugo Authors. All rights reserved. +// Copyright 2019 The Hugo Authors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,6 +20,8 @@ "strings" "time" + "github.com/gohugoio/hugo/resources/page" + "github.com/gohugoio/hugo/hugofs" "github.com/gohugoio/hugo/helpers" @@ -124,8 +126,8 @@ site := h.Sites[0] - site.Log.FEEDBACK.Println("processing", len(site.AllPages), "content files") - for _, p := range site.AllPages { + site.Log.FEEDBACK.Println("processing", len(site.AllPages()), "content files") + for _, p := range site.AllPages() { if err := cc.convertAndSavePage(p, site, format); err != nil { return err } @@ -133,24 +135,24 @@ return nil } -func (cc *convertCmd) convertAndSavePage(p *hugolib.Page, site *hugolib.Site, targetFormat metadecoders.Format) error { +func (cc *convertCmd) convertAndSavePage(p page.Page, site *hugolib.Site, targetFormat metadecoders.Format) error { // The resources are not in .Site.AllPages. - for _, r := range p.Resources.ByType("page") { - if err := cc.convertAndSavePage(r.(*hugolib.Page), site, targetFormat); err != nil { + for _, r := range p.Resources().ByType("page") { + if err := cc.convertAndSavePage(r.(page.Page), site, targetFormat); err != nil { return err } } - if p.Filename() == "" { + if p.File().IsZero() { // No content file. return nil } errMsg := fmt.Errorf("Error processing file %q", p.Path()) - site.Log.INFO.Println("Attempting to convert", p.LogicalName()) + site.Log.INFO.Println("Attempting to convert", p.File().Filename()) - f, _ := p.File.(src.ReadableFile) + f, _ := p.File().(src.ReadableFile) file, err := f.Open() if err != nil { site.Log.ERROR.Println(errMsg) @@ -186,7 +188,7 @@ newContent.Write(pf.content) - newFilename := p.Filename() + newFilename := p.File().Filename() if cc.outputDir != "" { contentDir := strings.TrimSuffix(newFilename, p.Path()) diff -Nru hugo-0.54.0/commands/hugo.go hugo-0.55.1/commands/hugo.go --- hugo-0.54.0/commands/hugo.go 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/commands/hugo.go 2019-04-12 09:56:13.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright 2018 The Hugo Authors. All rights reserved. +// Copyright 2019 The Hugo Authors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -18,11 +18,16 @@ import ( "fmt" "io/ioutil" - "os/signal" + "runtime/pprof" + "runtime/trace" "sort" "sync/atomic" + "github.com/gohugoio/hugo/hugofs" + + "github.com/gohugoio/hugo/resources/page" + "github.com/gohugoio/hugo/common/hugo" "github.com/pkg/errors" @@ -214,6 +219,7 @@ "themesDir", "verbose", "verboseLog", + "duplicateTargetPaths", } // Will set a value even if it is the default. @@ -235,6 +241,7 @@ // Set some "config aliases" setValueFromFlag(cmd.Flags(), "destination", cfg, "publishDir", false) setValueFromFlag(cmd.Flags(), "i18n-warnings", cfg, "logI18nWarnings", false) + setValueFromFlag(cmd.Flags(), "path-warnings", cfg, "logPathWarnings", false) } @@ -290,6 +297,7 @@ } copyStaticFunc := func() error { + cnt, err := c.copyStatic() if err != nil { if !os.IsNotExist(err) { @@ -326,7 +334,7 @@ } for _, s := range c.hugo.Sites { - s.ProcessingStats.Static = langCount[s.Language.Lang] + s.ProcessingStats.Static = langCount[s.Language().Lang] } if c.h.gc { @@ -344,9 +352,125 @@ } +func (c *commandeer) initCPUProfile() (func(), error) { + if c.h.cpuprofile == "" { + return nil, nil + } + + f, err := os.Create(c.h.cpuprofile) + if err != nil { + return nil, errors.Wrap(err, "failed to create CPU profile") + } + if err := pprof.StartCPUProfile(f); err != nil { + return nil, errors.Wrap(err, "failed to start CPU profile") + } + return func() { + pprof.StopCPUProfile() + f.Close() + }, nil +} + +func (c *commandeer) initMemProfile() { + if c.h.memprofile == "" { + return + } + + f, err := os.Create(c.h.memprofile) + if err != nil { + c.logger.ERROR.Println("could not create memory profile: ", err) + } + defer f.Close() + runtime.GC() // get up-to-date statistics + if err := pprof.WriteHeapProfile(f); err != nil { + c.logger.ERROR.Println("could not write memory profile: ", err) + } +} + +func (c *commandeer) initTraceProfile() (func(), error) { + if c.h.traceprofile == "" { + return nil, nil + } + + f, err := os.Create(c.h.traceprofile) + if err != nil { + return nil, errors.Wrap(err, "failed to create trace file") + } + + if err := trace.Start(f); err != nil { + return nil, errors.Wrap(err, "failed to start trace") + } + + return func() { + trace.Stop() + f.Close() + }, nil +} + +func (c *commandeer) initMutexProfile() (func(), error) { + if c.h.mutexprofile == "" { + return nil, nil + } + + f, err := os.Create(c.h.mutexprofile) + if err != nil { + return nil, err + } + + runtime.SetMutexProfileFraction(1) + + return func() { + pprof.Lookup("mutex").WriteTo(f, 0) + f.Close() + }, nil + +} + +func (c *commandeer) initProfiling() (func(), error) { + stopCPUProf, err := c.initCPUProfile() + if err != nil { + return nil, err + } + + defer c.initMemProfile() + + stopMutexProf, err := c.initMutexProfile() + if err != nil { + return nil, err + } + + stopTraceProf, err := c.initTraceProfile() + if err != nil { + return nil, err + } + + return func() { + if stopCPUProf != nil { + stopCPUProf() + } + if stopMutexProf != nil { + stopMutexProf() + } + + if stopTraceProf != nil { + stopTraceProf() + } + }, nil +} + func (c *commandeer) build() error { defer c.timeTrack(time.Now(), "Total") + stopProfiling, err := c.initProfiling() + if err != nil { + return err + } + + defer func() { + if stopProfiling != nil { + stopProfiling() + } + }() + if err := c.fullBuild(); err != nil { return err } @@ -356,6 +480,13 @@ fmt.Println() c.hugo.PrintProcessingStats(os.Stdout) fmt.Println() + + if createCounter, ok := c.destinationFs.(hugofs.DuplicatesReporter); ok { + dupes := createCounter.ReportDuplicates() + if dupes != "" { + c.logger.WARN.Println("Duplicate target paths:", dupes) + } + } } if c.h.buildWatch { @@ -369,7 +500,7 @@ checkErr(c.Logger, err) defer watcher.Close() - var sigs = make(chan os.Signal) + var sigs = make(chan os.Signal, 1) signal.Notify(sigs, syscall.SIGINT, syscall.SIGTERM) <-sigs @@ -381,6 +512,17 @@ func (c *commandeer) serverBuild() error { defer c.timeTrack(time.Now(), "Total") + stopProfiling, err := c.initProfiling() + if err != nil { + return err + } + + defer func() { + if stopProfiling != nil { + stopProfiling() + } + }() + if err := c.fullBuild(); err != nil { return err } @@ -474,11 +616,9 @@ } c.logger.INFO.Println("syncing static files to", publishDir) - var err error - // because we are using a baseFs (to get the union right). // set sync src to root - err = syncer.Sync(publishDir, helpers.FilePathSeparator) + err := syncer.Sync(publishDir, helpers.FilePathSeparator) if err != nil { return 0, err } @@ -619,13 +759,6 @@ return a, nil } -func (c *commandeer) resetAndBuildSites() (err error) { - if !c.h.quiet { - c.logger.FEEDBACK.Println("Started building sites ...") - } - return c.hugo.Build(hugolib.BuildCfg{ResetState: true}) -} - func (c *commandeer) buildSites() (err error) { return c.hugo.Build(hugolib.BuildCfg{}) } @@ -973,7 +1106,7 @@ navigate := c.Cfg.GetBool("navigateToChanged") // We have fetched the same page above, but it may have // changed. - var p *hugolib.Page + var p page.Page if navigate { if onePageName != "" { @@ -982,7 +1115,7 @@ } if p != nil { - livereload.NavigateToPathForPort(p.RelPermalink(), p.Site.ServerPort()) + livereload.NavigateToPathForPort(p.RelPermalink(), p.Site().ServerPort()) } else { livereload.ForceRefresh() } @@ -1044,9 +1177,11 @@ } b, err := afero.ReadFile(fs, path) + if err != nil { + continue + } tomlMeta, err := metadecoders.Default.UnmarshalToMap(b, metadecoders.TOML) - if err != nil { continue } diff -Nru hugo-0.54.0/commands/import_jekyll.go hugo-0.55.1/commands/import_jekyll.go --- hugo-0.54.0/commands/import_jekyll.go 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/commands/import_jekyll.go 2019-04-12 09:56:13.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright 2016 The Hugo Authors. All rights reserved. +// Copyright 2019 The Hugo Authors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -340,7 +340,7 @@ if err != nil { return err } - entries, err := ioutil.ReadDir(source) + entries, _ := ioutil.ReadDir(source) for _, entry := range entries { sfp := filepath.Join(source, entry.Name()) dfp := filepath.Join(dest, entry.Name()) @@ -373,6 +373,10 @@ return err } entries, err := ioutil.ReadDir(jekyllRoot) + if err != nil { + return err + } + for _, entry := range entries { sfp := filepath.Join(jekyllRoot, entry.Name()) dfp := filepath.Join(dest, entry.Name()) @@ -464,7 +468,7 @@ fs := hugofs.Os if err := helpers.WriteToDisk(targetFile, strings.NewReader(content), fs); err != nil { - return fmt.Errorf("Failed to save file %q:", filename) + return fmt.Errorf("failed to save file %q: %s", filename, err) } return nil diff -Nru hugo-0.54.0/commands/limit_darwin.go hugo-0.55.1/commands/limit_darwin.go --- hugo-0.54.0/commands/limit_darwin.go 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/commands/limit_darwin.go 2019-04-12 09:56:13.000000000 +0000 @@ -36,14 +36,17 @@ var rLimit syscall.Rlimit err := syscall.Getrlimit(syscall.RLIMIT_NOFILE, &rLimit) if err != nil { - return newSystemError("Error Getting Rlimit ", err) + return newSystemError("Error Getting rlimit ", err) } jww.FEEDBACK.Println("Current rLimit:", rLimit) + if rLimit.Cur >= newRlimit { + return nil + } + jww.FEEDBACK.Println("Attempting to increase limit") - rLimit.Max = 999999 - rLimit.Cur = 999999 + rLimit.Cur = newRlimit err = syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rLimit) if err != nil { return newSystemError("Error Setting rLimit ", err) @@ -61,18 +64,21 @@ return &limitCmd{baseCmd: newBaseCmd(ccmd)} } +const newRlimit = 10240 + func tweakLimit() { var rLimit syscall.Rlimit err := syscall.Getrlimit(syscall.RLIMIT_NOFILE, &rLimit) if err != nil { - jww.ERROR.Println("Unable to obtain rLimit", err) + jww.WARN.Println("Unable to get rlimit:", err) + return } - if rLimit.Cur < rLimit.Max { - rLimit.Max = 64000 - rLimit.Cur = 64000 + if rLimit.Cur < newRlimit { + rLimit.Cur = newRlimit err = syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rLimit) if err != nil { - jww.WARN.Println("Unable to increase number of open files limit", err) + // This may not succeed, see https://github.com/golang/go/issues/30401 + jww.INFO.Println("Unable to increase number of open files limit:", err) } } } diff -Nru hugo-0.54.0/commands/list.go hugo-0.55.1/commands/list.go --- hugo-0.54.0/commands/list.go 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/commands/list.go 2019-04-12 09:56:13.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright 2015 The Hugo Authors. All rights reserved. +// Copyright 2019 The Hugo Authors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -14,9 +14,13 @@ package commands import ( + "encoding/csv" + "os" "path/filepath" + "time" "github.com/gohugoio/hugo/hugolib" + "github.com/gohugoio/hugo/resources/resource" "github.com/spf13/cobra" jww "github.com/spf13/jwalterweatherman" ) @@ -67,7 +71,7 @@ for _, p := range sites.Pages() { if p.IsDraft() { - jww.FEEDBACK.Println(filepath.Join(p.File.Dir(), p.File.LogicalName())) + jww.FEEDBACK.Println(filepath.Join(p.File().Dir(), p.File().LogicalName())) } } @@ -101,11 +105,16 @@ return newSystemError("Error Processing Source Content", err) } + writer := csv.NewWriter(os.Stdout) + defer writer.Flush() + for _, p := range sites.Pages() { - if p.IsFuture() { - jww.FEEDBACK.Println(filepath.Join(p.File.Dir(), p.File.LogicalName())) + if resource.IsFuture(p) { + err := writer.Write([]string{filepath.Join(p.File().Dir(), p.File().LogicalName()), p.PublishDate().Format(time.RFC3339)}) + if err != nil { + return newSystemError("Error writing future posts to stdout", err) + } } - } return nil @@ -137,11 +146,17 @@ return newSystemError("Error Processing Source Content", err) } + writer := csv.NewWriter(os.Stdout) + defer writer.Flush() + for _, p := range sites.Pages() { - if p.IsExpired() { - jww.FEEDBACK.Println(filepath.Join(p.File.Dir(), p.File.LogicalName())) - } + if resource.IsExpired(p) { + err := writer.Write([]string{filepath.Join(p.File().Dir(), p.File().LogicalName()), p.ExpiryDate().Format(time.RFC3339)}) + if err != nil { + return newSystemError("Error writing expired posts to stdout", err) + } + } } return nil diff -Nru hugo-0.54.0/commands/new_content_test.go hugo-0.55.1/commands/new_content_test.go --- hugo-0.54.0/commands/new_content_test.go 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/commands/new_content_test.go 2019-04-12 09:56:13.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright 2018 The Hugo Authors. All rights reserved. +// Copyright 2019 The Hugo Authors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -62,7 +62,7 @@ _, fs := newTestCfg() n := newNewSiteCmd() - require.NoError(t, fs.Source.MkdirAll(basepath, 777)) + require.NoError(t, fs.Source.MkdirAll(basepath, 0777)) require.NoError(t, n.doNewSite(fs, basepath, false)) } @@ -72,7 +72,7 @@ _, fs := newTestCfg() n := newNewSiteCmd() - require.NoError(t, fs.Source.MkdirAll(basepath, 777)) + require.NoError(t, fs.Source.MkdirAll(basepath, 0777)) _, err := fs.Source.Create(filepath.Join(basepath, "foo")) require.NoError(t, err) // Since the directory already exists and isn't empty, expect an error @@ -85,7 +85,7 @@ _, fs := newTestCfg() n := newNewSiteCmd() - require.NoError(t, fs.Source.MkdirAll(basepath, 777)) + require.NoError(t, fs.Source.MkdirAll(basepath, 0777)) require.NoError(t, n.doNewSite(fs, basepath, true)) @@ -99,7 +99,7 @@ contentPath := filepath.Join(basepath, "content") - require.NoError(t, fs.Source.MkdirAll(contentPath, 777)) + require.NoError(t, fs.Source.MkdirAll(contentPath, 0777)) require.Error(t, n.doNewSite(fs, basepath, true)) } @@ -109,7 +109,7 @@ n := newNewSiteCmd() configPath := filepath.Join(basepath, "config.toml") - require.NoError(t, fs.Source.MkdirAll(basepath, 777)) + require.NoError(t, fs.Source.MkdirAll(basepath, 0777)) _, err := fs.Source.Create(configPath) require.NoError(t, err) diff -Nru hugo-0.54.0/commands/server.go hugo-0.55.1/commands/server.go --- hugo-0.54.0/commands/server.go 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/commands/server.go 2019-04-12 09:56:13.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright 2018 The Hugo Authors. All rights reserved. +// Copyright 2019 The Hugo Authors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -358,7 +358,7 @@ if err := f.c.partialReRender(p); err != nil { f.c.handleBuildErr(err, fmt.Sprintf("Failed to render %q", p)) if f.c.showErrorInBrowser { - http.Redirect(w, r, p, 301) + http.Redirect(w, r, p, http.StatusMovedPermanently) return } } @@ -386,7 +386,7 @@ return mu, u.String(), endpoint, nil } -var logErrorRe = regexp.MustCompile("(?s)ERROR \\d{4}/\\d{2}/\\d{2} \\d{2}:\\d{2}:\\d{2} ") +var logErrorRe = regexp.MustCompile(`(?s)ERROR \d{4}/\d{2}/\d{2} \d{2}:\d{2}:\d{2} `) func removeErrorPrefixFromLog(content string) string { return logErrorRe.ReplaceAllLiteralString(content, "") @@ -403,7 +403,7 @@ if isMultiHost { for _, s := range c.hugo.Sites { baseURLs = append(baseURLs, s.BaseURL.String()) - roots = append(roots, s.Language.Lang) + roots = append(roots, s.Language().Lang) } } else { s := c.hugo.Sites[0] @@ -430,7 +430,7 @@ livereload.Initialize() } - var sigs = make(chan os.Signal) + var sigs = make(chan os.Signal, 1) signal.Notify(sigs, syscall.SIGINT, syscall.SIGTERM) for i := range baseURLs { diff -Nru hugo-0.54.0/common/collections/append.go hugo-0.55.1/common/collections/append.go --- hugo-0.54.0/common/collections/append.go 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/common/collections/append.go 2019-04-12 09:56:13.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright 2018 The Hugo Authors. All rights reserved. +// Copyright 2019 The Hugo Authors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -92,9 +92,7 @@ tos = append(tos, tov.Index(i).Interface()) } - for _, v := range from { - tos = append(tos, v) - } + tos = append(tos, from...) return tos, nil } diff -Nru hugo-0.54.0/common/collections/slice_test.go hugo-0.55.1/common/collections/slice_test.go --- hugo-0.54.0/common/collections/slice_test.go 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/common/collections/slice_test.go 2019-04-12 09:56:13.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright 2018 The Hugo Authors. All rights reserved. +// Copyright 2019 The Hugo Authors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -75,11 +75,11 @@ } func (p *tstSlicerIn1) Name() string { - return p.Name() + return p.name } func (p *tstSlicerIn2) Name() string { - return p.Name() + return p.name } func (p *tstSlicer) Slice(in interface{}) (interface{}, error) { diff -Nru hugo-0.54.0/common/herrors/error_locator.go hugo-0.55.1/common/herrors/error_locator.go --- hugo-0.54.0/common/herrors/error_locator.go 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/common/herrors/error_locator.go 2019-04-12 09:56:13.000000000 +0000 @@ -173,7 +173,7 @@ } func extNoDelimiter(filename string) string { - return strings.TrimPrefix(".", filepath.Ext(filename)) + return strings.TrimPrefix(filepath.Ext(filename), ".") } func chromaLexerFromFilename(filename string) string { diff -Nru hugo-0.54.0/common/herrors/errors.go hugo-0.55.1/common/herrors/errors.go --- hugo-0.54.0/common/herrors/errors.go 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/common/herrors/errors.go 2019-04-12 09:56:13.000000000 +0000 @@ -50,4 +50,4 @@ // // We will, at least to begin with, make some Hugo features (SCSS with libsass) optional, // and this error is used to signal those situations. -var ErrFeatureNotAvailable = errors.New("this feature is not available in your current Hugo version") +var ErrFeatureNotAvailable = errors.New("this feature is not available in your current Hugo version, see https://goo.gl/YMrWcn for more information") diff -Nru hugo-0.54.0/common/hreflect/helpers.go hugo-0.55.1/common/hreflect/helpers.go --- hugo-0.54.0/common/hreflect/helpers.go 1970-01-01 00:00:00.000000000 +0000 +++ hugo-0.55.1/common/hreflect/helpers.go 2019-04-12 09:56:13.000000000 +0000 @@ -0,0 +1,91 @@ +// Copyright 2019 The Hugo Authors. All rights reserved. +// Some functions in this file (see comments) is based on the Go source code, +// copyright The Go Authors and governed by a BSD-style license. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Package hreflect contains reflect helpers. +package hreflect + +import ( + "reflect" + + "github.com/gohugoio/hugo/common/types" +) + +// IsTruthful returns whether in represents a truthful value. +// See IsTruthfulValue +func IsTruthful(in interface{}) bool { + switch v := in.(type) { + case reflect.Value: + return IsTruthfulValue(v) + default: + return IsTruthfulValue(reflect.ValueOf(in)) + } + +} + +var zeroType = reflect.TypeOf((*types.Zeroer)(nil)).Elem() + +// IsTruthfulValue returns whether the given value has a meaningful truth value. +// This is based on template.IsTrue in Go's stdlib, but also considers +// IsZero and any interface value will be unwrapped before it's considered +// for truthfulness. +// +// Based on: +// https://github.com/golang/go/blob/178a2c42254166cffed1b25fb1d3c7a5727cada6/src/text/template/exec.go#L306 +func IsTruthfulValue(val reflect.Value) (truth bool) { + val = indirectInterface(val) + + if !val.IsValid() { + // Something like var x interface{}, never set. It's a form of nil. + return + } + + if val.Type().Implements(zeroType) { + return !val.Interface().(types.Zeroer).IsZero() + } + + switch val.Kind() { + case reflect.Array, reflect.Map, reflect.Slice, reflect.String: + truth = val.Len() > 0 + case reflect.Bool: + truth = val.Bool() + case reflect.Complex64, reflect.Complex128: + truth = val.Complex() != 0 + case reflect.Chan, reflect.Func, reflect.Ptr, reflect.Interface: + truth = !val.IsNil() + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + truth = val.Int() != 0 + case reflect.Float32, reflect.Float64: + truth = val.Float() != 0 + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: + truth = val.Uint() != 0 + case reflect.Struct: + truth = true // Struct values are always true. + default: + return + } + + return +} + +// Based on: https://github.com/golang/go/blob/178a2c42254166cffed1b25fb1d3c7a5727cada6/src/text/template/exec.go#L931 +func indirectInterface(v reflect.Value) reflect.Value { + if v.Kind() != reflect.Interface { + return v + } + if v.IsNil() { + return reflect.Value{} + } + return v.Elem() +} diff -Nru hugo-0.54.0/common/hreflect/helpers_test.go hugo-0.55.1/common/hreflect/helpers_test.go --- hugo-0.54.0/common/hreflect/helpers_test.go 1970-01-01 00:00:00.000000000 +0000 +++ hugo-0.55.1/common/hreflect/helpers_test.go 2019-04-12 09:56:13.000000000 +0000 @@ -0,0 +1,42 @@ +// Copyright 2019 The Hugo Authors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package hreflect + +import ( + "reflect" + "testing" + "time" + + "github.com/stretchr/testify/require" +) + +func TestIsTruthful(t *testing.T) { + assert := require.New(t) + + assert.True(IsTruthful(true)) + assert.False(IsTruthful(false)) + assert.True(IsTruthful(time.Now())) + assert.False(IsTruthful(time.Time{})) +} + +func BenchmarkIsTruthFul(b *testing.B) { + v := reflect.ValueOf("Hugo") + + b.ResetTimer() + for i := 0; i < b.N; i++ { + if !IsTruthfulValue(v) { + b.Fatal("not truthful") + } + } +} diff -Nru hugo-0.54.0/common/hugio/readers.go hugo-0.55.1/common/hugio/readers.go --- hugo-0.54.0/common/hugio/readers.go 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/common/hugio/readers.go 2019-04-12 09:56:13.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright 2018 The Hugo Authors. All rights reserved. +// Copyright 2019 The Hugo Authors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -32,6 +32,7 @@ } // ReadSeekerNoOpCloser implements ReadSeekCloser by doing nothing in Close. +// TODO(bep) rename this and simila to ReadSeekerNopCloser, naming used in stdlib, which kind of makes sense. type ReadSeekerNoOpCloser struct { ReadSeeker } diff -Nru hugo-0.54.0/common/hugo/site.go hugo-0.55.1/common/hugo/site.go --- hugo-0.54.0/common/hugo/site.go 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/common/hugo/site.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,24 +0,0 @@ -// Copyright 2018 The Hugo Authors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package hugo - -import "github.com/gohugoio/hugo/langs" - -// Site represents a site in the build. This is currently a very narrow interface, -// but the actual implementation will be richer, see hugolib.SiteInfo. -type Site interface { - Language() *langs.Language - IsServer() bool - Hugo() Info -} diff -Nru hugo-0.54.0/common/hugo/version_current.go hugo-0.55.1/common/hugo/version_current.go --- hugo-0.54.0/common/hugo/version_current.go 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/common/hugo/version_current.go 2019-04-12 09:56:13.000000000 +0000 @@ -16,7 +16,7 @@ // CurrentVersion represents the current build version. // This should be the only one. var CurrentVersion = Version{ - Number: 0.54, - PatchLevel: 0, + Number: 0.55, + PatchLevel: 1, Suffix: "", } diff -Nru hugo-0.54.0/common/maps/scratch.go hugo-0.55.1/common/maps/scratch.go --- hugo-0.54.0/common/maps/scratch.go 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/common/maps/scratch.go 2019-04-12 09:56:13.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright 2018 The Hugo Authors. All rights reserved. +// Copyright 2019 The Hugo Authors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -28,6 +28,24 @@ mu sync.RWMutex } +// Scratcher provides a scratching service. +type Scratcher interface { + Scratch() *Scratch +} + +type scratcher struct { + s *Scratch +} + +func (s scratcher) Scratch() *Scratch { + return s.s +} + +// NewScratcher creates a new Scratcher. +func NewScratcher() Scratcher { + return scratcher{s: NewScratch()} +} + // Add will, for single values, add (using the + operator) the addend to the existing addend (if found). // Supports numeric values and strings. // diff -Nru hugo-0.54.0/common/math/math.go hugo-0.55.1/common/math/math.go --- hugo-0.54.0/common/math/math.go 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/common/math/math.go 2019-04-12 09:56:13.000000000 +0000 @@ -46,7 +46,7 @@ bu = 0 } default: - return nil, errors.New("Can't apply the operator to the values") + return nil, errors.New("can't apply the operator to the values") } case reflect.Float32, reflect.Float64: af = av.Float() @@ -58,7 +58,7 @@ case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: bf = float64(bv.Uint()) // may overflow default: - return nil, errors.New("Can't apply the operator to the values") + return nil, errors.New("can't apply the operator to the values") } case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: au = av.Uint() @@ -79,7 +79,7 @@ case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: bu = bv.Uint() default: - return nil, errors.New("Can't apply the operator to the values") + return nil, errors.New("can't apply the operator to the values") } case reflect.String: as := av.String() @@ -87,9 +87,9 @@ bs := bv.String() return as + bs, nil } - return nil, errors.New("Can't apply the operator to the values") + return nil, errors.New("can't apply the operator to the values") default: - return nil, errors.New("Can't apply the operator to the values") + return nil, errors.New("can't apply the operator to the values") } switch op { @@ -128,8 +128,8 @@ } else if bu != 0 { return au / bu, nil } - return nil, errors.New("Can't divide the value by 0") + return nil, errors.New("can't divide the value by 0") default: - return nil, errors.New("There is no such an operation") + return nil, errors.New("there is no such an operation") } } diff -Nru hugo-0.54.0/common/types/types.go hugo-0.55.1/common/types/types.go --- hugo-0.54.0/common/types/types.go 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/common/types/types.go 2019-04-12 09:56:13.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright 2018 The Hugo Authors. All rights reserved. +// Copyright 2019 The Hugo Authors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,6 +16,7 @@ import ( "fmt" + "reflect" "github.com/spf13/cast" ) @@ -50,3 +51,30 @@ } return KeyValues{Key: key, Values: iv} } + +// Zeroer, as implemented by time.Time, will be used by the truth template +// funcs in Hugo (if, with, not, and, or). +type Zeroer interface { + IsZero() bool +} + +// IsNil reports whether v is nil. +func IsNil(v interface{}) bool { + if v == nil { + return true + } + + value := reflect.ValueOf(v) + switch value.Kind() { + case reflect.Chan, reflect.Func, reflect.Interface, reflect.Map, reflect.Ptr, reflect.Slice: + return value.IsNil() + } + + return false +} + +// DevMarker is a marker interface for types that should only be used during +// development. +type DevMarker interface { + DevOnly() +} diff -Nru hugo-0.54.0/compare/compare.go hugo-0.55.1/compare/compare.go --- hugo-0.54.0/compare/compare.go 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/compare/compare.go 2019-04-12 09:56:13.000000000 +0000 @@ -20,6 +20,12 @@ Eq(other interface{}) bool } +// ProbablyEq is an equal check that may return false positives, but never +// a false negative. +type ProbablyEqer interface { + ProbablyEq(other interface{}) bool +} + // Comparer can be used to compare two values. // This will be used when using the le, ge etc. operators in the templates. // Compare returns -1 if the given version is less than, 0 if equal and 1 if greater than diff -Nru hugo-0.54.0/config/configProvider.go hugo-0.55.1/config/configProvider.go --- hugo-0.54.0/config/configProvider.go 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/config/configProvider.go 2019-04-12 09:56:13.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright 2017-present The Hugo Authors. All rights reserved. +// Copyright 2019 The Hugo Authors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,3 +40,15 @@ } return cast.ToStringSlice(sd) } + +// SetBaseTestDefaults provides some common config defaults used in tests. +func SetBaseTestDefaults(cfg Provider) { + cfg.Set("resourceDir", "resources") + cfg.Set("contentDir", "content") + cfg.Set("dataDir", "data") + cfg.Set("i18nDir", "i18n") + cfg.Set("layoutDir", "layouts") + cfg.Set("assetDir", "assets") + cfg.Set("archetypeDir", "archetypes") + cfg.Set("publishDir", "public") +} diff -Nru hugo-0.54.0/config/env.go hugo-0.55.1/config/env.go --- hugo-0.54.0/config/env.go 1970-01-01 00:00:00.000000000 +0000 +++ hugo-0.55.1/config/env.go 2019-04-12 09:56:13.000000000 +0000 @@ -0,0 +1,33 @@ +// Copyright 2019 The Hugo Authors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package config + +import ( + "os" + "runtime" + "strconv" +) + +// GetNumWorkerMultiplier returns the base value used to calculate the number +// of workers to use for Hugo's parallel execution. +// It returns the value in HUGO_NUMWORKERMULTIPLIER OS env variable if set to a +// positive integer, else the number of logical CPUs. +func GetNumWorkerMultiplier() int { + if gmp := os.Getenv("HUGO_NUMWORKERMULTIPLIER"); gmp != "" { + if p, err := strconv.Atoi(gmp); err == nil && p > 0 { + return p + } + } + return runtime.NumCPU() +} diff -Nru hugo-0.54.0/config/services/servicesConfig.go hugo-0.55.1/config/services/servicesConfig.go --- hugo-0.54.0/config/services/servicesConfig.go 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/config/services/servicesConfig.go 2019-04-12 09:56:13.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright 2018 The Hugo Authors. All rights reserved. +// Copyright 2019 The Hugo Authors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -23,6 +23,7 @@ disqusShortnameKey = "disqusshortname" googleAnalyticsKey = "googleanalytics" + rssLimitKey = "rssLimit" ) // Config is a privacy configuration for all the relevant services in Hugo. @@ -31,6 +32,7 @@ GoogleAnalytics GoogleAnalytics Instagram Instagram Twitter Twitter + RSS RSS } // Disqus holds the functional configuration settings related to the Disqus template. @@ -61,6 +63,12 @@ DisableInlineCSS bool } +// RSS holds the functional configuration settings related to the RSS feeds. +type RSS struct { + // Limit the number of pages. + Limit int +} + // DecodeConfig creates a services Config from a given Hugo configuration. func DecodeConfig(cfg config.Provider) (c Config, err error) { m := cfg.GetStringMap(servicesConfigKey) @@ -76,5 +84,9 @@ c.Disqus.Shortname = cfg.GetString(disqusShortnameKey) } + if c.RSS.Limit == 0 { + c.RSS.Limit = cfg.GetInt(rssLimitKey) + } + return } diff -Nru hugo-0.54.0/config/sitemap.go hugo-0.55.1/config/sitemap.go --- hugo-0.54.0/config/sitemap.go 1970-01-01 00:00:00.000000000 +0000 +++ hugo-0.55.1/config/sitemap.go 2019-04-12 09:56:13.000000000 +0000 @@ -0,0 +1,44 @@ +// Copyright 2019 The Hugo Authors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package config + +import ( + "github.com/spf13/cast" + jww "github.com/spf13/jwalterweatherman" +) + +// Sitemap configures the sitemap to be generated. +type Sitemap struct { + ChangeFreq string + Priority float64 + Filename string +} + +func DecodeSitemap(prototype Sitemap, input map[string]interface{}) Sitemap { + + for key, value := range input { + switch key { + case "changefreq": + prototype.ChangeFreq = cast.ToString(value) + case "priority": + prototype.Priority = cast.ToFloat64(value) + case "filename": + prototype.Filename = cast.ToString(value) + default: + jww.WARN.Printf("Unknown Sitemap field: %s\n", key) + } + } + + return prototype +} diff -Nru hugo-0.54.0/create/content.go hugo-0.55.1/create/content.go --- hugo-0.54.0/create/content.go 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/create/content.go 2019-04-12 09:56:13.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright 2016 The Hugo Authors. All rights reserved. +// Copyright 2019 The Hugo Authors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -50,7 +50,7 @@ if isDir { - langFs := hugofs.NewLanguageFs(s.Language.Lang, sites.LanguageSet(), archetypeFs) + langFs := hugofs.NewLanguageFs(s.Language().Lang, sites.LanguageSet(), archetypeFs) cm, err := mapArcheTypeDir(ps, langFs, archetypeFilename) if err != nil { @@ -113,7 +113,7 @@ func targetSite(sites *hugolib.HugoSites, fi *hugofs.LanguageFileInfo) *hugolib.Site { for _, s := range sites.Sites { - if fi.Lang() == s.Language.Lang { + if fi.Lang() == s.Language().Lang { return s } } @@ -142,6 +142,9 @@ } out, err := targetFs.Create(targetFilename) + if err != nil { + return err + } _, err = io.Copy(out, in) if err != nil { @@ -245,7 +248,7 @@ // Try the filename: my-post.en.md for _, ss := range sites.Sites { - if strings.Contains(targetPath, "."+ss.Language.Lang+".") { + if strings.Contains(targetPath, "."+ss.Language().Lang+".") { s = ss break } diff -Nru hugo-0.54.0/debian/changelog hugo-0.55.1/debian/changelog --- hugo-0.54.0/debian/changelog 2019-02-01 18:13:18.000000000 +0000 +++ hugo-0.55.1/debian/changelog 2019-04-14 19:36:44.000000000 +0000 @@ -1,3 +1,19 @@ +hugo (0.55.1-1) unstable; urgency=medium + + * New upstream version 0.55.1 + * Update files list in debian/copyright + + -- Anthony Fok Sun, 14 Apr 2019 13:36:44 -0600 + +hugo (0.55.0-1) unstable; urgency=medium + + * New upstream version 0.55.0 + * Update dependencies as per upstream go.mod + * Update files list and copyright years in debian/copyright + * Refresh 004-increase-timeout-in-TestPageBundlerSiteRegular.patch + + -- Anthony Fok Sun, 14 Apr 2019 04:46:30 -0600 + hugo (0.54.0-1) unstable; urgency=medium * New upstream version 0.54.0 diff -Nru hugo-0.54.0/debian/control hugo-0.55.1/debian/control --- hugo-0.54.0/debian/control 2019-02-01 18:11:10.000000000 +0000 +++ hugo-0.55.1/debian/control 2019-04-14 10:45:54.000000000 +0000 @@ -10,14 +10,14 @@ debhelper (>= 11~), dh-golang (>= 1.39~), golang-any (>= 2:1.11~), - golang-github-alecthomas-chroma-dev (>= 0.6.2~), - golang-github-bep-debounce-dev, + golang-github-alecthomas-chroma-dev (>= 0.6.3~), + golang-github-bep-debounce-dev (>= 1.2.0~), golang-github-bep-gitmap-dev (>= 1.0.0~), golang-github-bep-go-tocss-dev (>= 0.6.0~), golang-github-burntsushi-locker-dev, golang-github-burntsushi-toml-dev, golang-github-chaseadamsio-goorgeous-dev, - golang-github-disintegration-imaging-dev, + golang-github-disintegration-imaging-dev (>= 1.6.0~), golang-github-dsnet-golib-dev, golang-github-eknkc-amber-dev, golang-github-fortytw2-leaktest-dev, @@ -28,6 +28,7 @@ golang-github-jdkato-prose-dev, golang-github-kyokomi-emoji-dev, golang-github-markbates-inflect-dev, + golang-github-mattn-go-isatty-dev (>= 0.0.7~), golang-github-miekg-mmark-dev, golang-github-mitchellh-hashstructure-dev, golang-github-mitchellh-mapstructure-dev (>= 1.1.2~), @@ -38,15 +39,14 @@ golang-github-puerkitobio-purell-dev, golang-github-russross-blackfriday-dev (>= 1.5.1~), golang-github-sanity-io-litter-dev, - golang-github-spf13-afero-dev (>= 1.2.1~), + golang-github-spf13-afero-dev (>= 1.2.2~), golang-github-spf13-cast-dev (>= 1.3.0~), golang-github-spf13-cobra-dev, golang-github-spf13-fsync-dev, - golang-github-spf13-jwalterweatherman-dev (>= 1.0.0+git20181028.94f6ae3~), - golang-github-spf13-nitro-dev, + golang-github-spf13-jwalterweatherman-dev (>= 1.1.0~), golang-github-spf13-pflag-dev, - golang-github-spf13-viper-dev (>= 1.3.1~), - golang-github-stretchr-testify-dev, + golang-github-spf13-viper-dev (>= 1.3.2~), + golang-github-stretchr-testify-dev (>= 1.3.0~), golang-github-tdewolff-minify-dev (>= 2.3.8~), golang-github-wellington-go-libsass-dev, golang-github-yosssi-ace-dev, @@ -88,14 +88,14 @@ Package: golang-github-gohugoio-hugo-dev Architecture: all Section: devel -Depends: golang-github-alecthomas-chroma-dev (>= 0.6.2~), - golang-github-bep-debounce-dev, +Depends: golang-github-alecthomas-chroma-dev (>= 0.6.3~), + golang-github-bep-debounce-dev (>= 1.2.0~), golang-github-bep-gitmap-dev (>= 1.0.0~), golang-github-bep-go-tocss-dev (>= 0.6.0~), golang-github-burntsushi-locker-dev, golang-github-burntsushi-toml-dev, golang-github-chaseadamsio-goorgeous-dev, - golang-github-disintegration-imaging-dev, + golang-github-disintegration-imaging-dev (>= 1.6.0~), golang-github-dsnet-golib-dev, golang-github-eknkc-amber-dev, golang-github-fortytw2-leaktest-dev, @@ -106,6 +106,7 @@ golang-github-jdkato-prose-dev, golang-github-kyokomi-emoji-dev, golang-github-markbates-inflect-dev, + golang-github-mattn-go-isatty-dev (>= 0.0.7~), golang-github-miekg-mmark-dev, golang-github-mitchellh-hashstructure-dev, golang-github-mitchellh-mapstructure-dev (>= 1.1.2~), @@ -117,15 +118,14 @@ golang-github-russross-blackfriday-dev, golang-github-sanity-io-litter-dev, golang-github-tdewolff-minify-dev (>= 2.3.8~), - golang-github-spf13-afero-dev (>= 1.2.1~), + golang-github-spf13-afero-dev (>= 1.2.2~), golang-github-spf13-cast-dev (>= 1.3.0~), golang-github-spf13-cobra-dev, golang-github-spf13-fsync-dev, - golang-github-spf13-jwalterweatherman-dev (>= 1.0.0+git20181028.94f6ae3~), - golang-github-spf13-nitro-dev, + golang-github-spf13-jwalterweatherman-dev (>= 1.1.0~), golang-github-spf13-pflag-dev, - golang-github-spf13-viper-dev (>= 1.3.1~), - golang-github-stretchr-testify-dev, + golang-github-spf13-viper-dev (>= 1.3.2~), + golang-github-stretchr-testify-dev (>= 1.3.0~), golang-github-wellington-go-libsass-dev, golang-github-yosssi-ace-dev, golang-golang-x-image-dev, diff -Nru hugo-0.54.0/debian/copyright hugo-0.55.1/debian/copyright --- hugo-0.54.0/debian/copyright 2018-12-24 14:04:22.000000000 +0000 +++ hugo-0.55.1/debian/copyright 2019-04-14 19:34:25.000000000 +0000 @@ -5,20 +5,21 @@ Files: main.go magefile.go bufferpool/* - cache/* commands/* common/* compare/* config/* create/* + cache/* codegen/* commands/* common/* compare/* config/* create/* deps/* docshelper/* helpers/* htesting/* hugofs/* hugolib/* i18n/* - langs/* livereload/* + langs/* lazy/* livereload/* media/* metrics/* minifiers/* + navigation/* output/* parser/* publisher/* - related/* releaser/* resource/* + related/* releaser/* resources/* snap/* source/* tpl/* transform/* watcher/* CONTRIBUTING.md LICENSE README.md requirements.txt - bench.sh benchSite.sh + bench.sh benchbep.sh benchSite.sh bepdock.sh .circleci/config.yml Dockerfile @@ -33,8 +34,12 @@ .mailmap pull-docs.sh .travis.yml - docs/archetypes/* docs/content/* docs/data/* docs/layouts/* docs/config.toml docs/pull-theme.sh docs/README.md + docs/archetypes/* + docs/config/* + docs/content/* + docs/data/* + docs/layouts/* docs/resources/* docs/static/apple-touch-icon.png docs/static/css/style.css @@ -53,7 +58,7 @@ docs/resources/.gitattributes docs/resources/_gen/images/* Copyright: 2013–2016 Steve Francia - 2015–2018 The Hugo Authors + 2015–2019 The Hugo Authors License: Apache-2.0 Files: docs/themes/gohugoioTheme/* @@ -108,7 +113,7 @@ http://web.archive.org/web/20140912210715/http://entypo.com/characters/ Files: debian/* -Copyright: 2015–2018 Anthony Fok +Copyright: 2015–2019 Anthony Fok 2016–2018 Dr. Tobias Quathamer License: Apache-2.0 Comment: Debian packaging is licensed under the same terms as upstream diff -Nru hugo-0.54.0/debian/missing-sources/app.js/main.js hugo-0.55.1/debian/missing-sources/app.js/main.js --- hugo-0.54.0/debian/missing-sources/app.js/main.js 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/debian/missing-sources/app.js/main.js 2019-04-12 09:56:13.000000000 +0000 @@ -3,7 +3,6 @@ import './clipboardjs.js' import './codeblocks.js' import './docsearch.js' -//import './hljs.js' import './lazysizes.js' import './menutoggle.js' import './scrolldir.js' diff -Nru hugo-0.54.0/debian/patches/004-increase-timeout-in-TestPageBundlerSiteRegular.patch hugo-0.55.1/debian/patches/004-increase-timeout-in-TestPageBundlerSiteRegular.patch --- hugo-0.54.0/debian/patches/004-increase-timeout-in-TestPageBundlerSiteRegular.patch 2018-12-21 15:02:20.000000000 +0000 +++ hugo-0.55.1/debian/patches/004-increase-timeout-in-TestPageBundlerSiteRegular.patch 2019-04-14 10:46:16.000000000 +0000 @@ -5,16 +5,16 @@ Origin: vendor Bug: https://github.com/gohugoio/hugo/issues/4672 Reviewed-by: Anthony Fok -Last-Update: 2018-12-21 +Last-Update: 2019-04-14 --- This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ --- a/hugolib/pagebundler_test.go +++ b/hugolib/pagebundler_test.go -@@ -82,6 +82,7 @@ +@@ -90,6 +90,7 @@ "section": []string{"HTML", "CUSTOMO"}, }) + cfg.Set("timeout", 600000) cfg.Set("uglyURLs", ugly) - s := buildSingleSite(t, deps.DepsCfg{Logger: loggers.NewWarningLogger(), Fs: fs, Cfg: cfg}, BuildCfg{}) + s := buildSingleSite(t, deps.DepsCfg{Logger: loggers.NewErrorLogger(), Fs: fs, Cfg: cfg}, BuildCfg{}) diff -Nru hugo-0.54.0/deps/deps.go hugo-0.55.1/deps/deps.go --- hugo-0.54.0/deps/deps.go 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/deps/deps.go 2019-04-12 09:56:13.000000000 +0000 @@ -7,13 +7,14 @@ "github.com/pkg/errors" "github.com/gohugoio/hugo/cache/filecache" - "github.com/gohugoio/hugo/common/hugo" "github.com/gohugoio/hugo/common/loggers" "github.com/gohugoio/hugo/config" "github.com/gohugoio/hugo/helpers" "github.com/gohugoio/hugo/hugofs" "github.com/gohugoio/hugo/langs" "github.com/gohugoio/hugo/media" + "github.com/gohugoio/hugo/resources/page" + "github.com/gohugoio/hugo/metrics" "github.com/gohugoio/hugo/output" "github.com/gohugoio/hugo/resources" @@ -33,6 +34,9 @@ // Used to log errors that may repeat itself many times. DistinctErrorLog *helpers.DistinctLogger + // Used to log warnings that may repeat itself many times. + DistinctWarningLog *helpers.DistinctLogger + // The templates to use. This will usually implement the full tpl.TemplateHandler. Tmpl tpl.TemplateFinder `json:"-"` @@ -67,7 +71,7 @@ Language *langs.Language // The site building. - Site hugo.Site + Site page.Site // All the output formats available for the current site. OutputFormatsConfig output.Formats @@ -232,11 +236,13 @@ } distinctErrorLogger := helpers.NewDistinctLogger(logger.ERROR) + distinctWarnLogger := helpers.NewDistinctLogger(logger.WARN) d := &Deps{ Fs: fs, Log: logger, DistinctErrorLog: distinctErrorLogger, + DistinctWarningLog: distinctWarnLogger, templateProvider: cfg.TemplateProvider, translationProvider: cfg.TranslationProvider, WithTemplate: cfg.WithTemplate, @@ -325,7 +331,7 @@ Language *langs.Language // The Site in use - Site hugo.Site + Site page.Site // The configuration to use. Cfg config.Provider diff -Nru hugo-0.54.0/Dockerfile hugo-0.55.1/Dockerfile --- hugo-0.54.0/Dockerfile 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/Dockerfile 2019-04-12 09:56:13.000000000 +0000 @@ -2,25 +2,31 @@ # Twitter: https://twitter.com/gohugoio # Website: https://gohugo.io/ -FROM golang:1.11-alpine3.7 AS build +FROM golang:1.11-stretch AS build -ENV CGO_ENABLED=0 -ENV GOOS=linux -ENV GO111MODULE=on WORKDIR /go/src/github.com/gohugoio/hugo -RUN apk add --no-cache \ - git \ - musl-dev +RUN apt-get install \ + git gcc g++ binutils COPY . /go/src/github.com/gohugoio/hugo/ -RUN go install -ldflags '-s -w' +ENV GO111MODULE=on +RUN go get -d . + +ARG CGO=0 +ENV CGO_ENABLED=${CGO} +ENV GOOS=linux + +# default non-existent build tag so -tags always has an arg +ARG BUILD_TAGS="99notag" +RUN go install -ldflags '-w -extldflags "-static"' -tags ${BUILD_TAGS} # --- FROM scratch COPY --from=build /go/bin/hugo /hugo -WORKDIR /site -VOLUME /site +ARG WORKDIR="/site" +WORKDIR ${WORKDIR} +VOLUME ${WORKDIR} EXPOSE 1313 ENTRYPOINT [ "/hugo" ] CMD [ "--help" ] diff -Nru hugo-0.54.0/.dockerignore hugo-0.55.1/.dockerignore --- hugo-0.54.0/.dockerignore 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/.dockerignore 2019-04-12 09:56:13.000000000 +0000 @@ -6,3 +6,4 @@ .circleci docs examples +Dockerfile diff -Nru hugo-0.54.0/docs/config/_default/config.toml hugo-0.55.1/docs/config/_default/config.toml --- hugo-0.54.0/docs/config/_default/config.toml 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/docs/config/_default/config.toml 2019-04-12 09:56:13.000000000 +0000 @@ -1,5 +1,5 @@ baseURL = "https://gohugo.io/" -paginate = 100 +paginate = 100 defaultContentLanguage = "en" enableEmoji = true # Set the unicode character used for the "return" link in page footnotes. @@ -48,6 +48,21 @@ isPlainText = true notAlternative = true +[caches] +[caches.getjson] +dir = ":cacheDir/:project" +maxAge = -1 +[caches.getcsv] +dir = ":cacheDir/:project" +maxAge = -1 +[caches.images] +dir = ":resourceDir/_gen" +maxAge = -1 +[caches.assets] +dir = ":resourceDir/_gen" +maxAge = -1 + + [related] threshold = 80 @@ -58,7 +73,7 @@ name = "keywords" weight = 100 [[related.indices]] -name = "date" +name = "date" weight = 10 pattern = "2006" diff -Nru hugo-0.54.0/docs/config/production/params.toml hugo-0.55.1/docs/config/production/params.toml --- hugo-0.54.0/docs/config/production/params.toml 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/docs/config/production/params.toml 2019-04-12 09:56:13.000000000 +0000 @@ -1,6 +1,2 @@ # Params for production -# This is turned off in development as it is relatively slow. -# This is needed to get accurate lastMod and Git commit info -# on the docs pages. -enableGitInfo = true diff -Nru hugo-0.54.0/docs/config.toml hugo-0.55.1/docs/config.toml --- hugo-0.54.0/docs/config.toml 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/docs/config.toml 2019-04-12 09:56:13.000000000 +0000 @@ -69,7 +69,7 @@ [params] description = "The world’s fastest framework for building websites" ## Used for views in rendered HTML (i.e., rather than using the .Hugo variable) - release = "0.54.0" + release = "0.55.0-DEV" ## Setting this to true will add a "noindex" to *EVERY* page on the site removefromexternalsearch = false ## Gh repo for site footer (include trailing slash) diff -Nru hugo-0.54.0/docs/content/en/commands/hugo_check.md hugo-0.55.1/docs/content/en/commands/hugo_check.md --- hugo-0.54.0/docs/content/en/commands/hugo_check.md 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/docs/content/en/commands/hugo_check.md 2019-04-12 09:56:13.000000000 +0000 @@ -1,5 +1,5 @@ --- -date: 2019-01-30 +date: 2019-03-26 title: "hugo check" slug: hugo_check url: /commands/hugo_check/ @@ -36,4 +36,4 @@ * [hugo](/commands/hugo/) - hugo builds your site * [hugo check ulimit](/commands/hugo_check_ulimit/) - Check system ulimit settings -###### Auto generated by spf13/cobra on 30-Jan-2019 +###### Auto generated by spf13/cobra on 26-Mar-2019 diff -Nru hugo-0.54.0/docs/content/en/commands/hugo_check_ulimit.md hugo-0.55.1/docs/content/en/commands/hugo_check_ulimit.md --- hugo-0.54.0/docs/content/en/commands/hugo_check_ulimit.md 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/docs/content/en/commands/hugo_check_ulimit.md 2019-04-12 09:56:13.000000000 +0000 @@ -1,5 +1,5 @@ --- -date: 2019-01-30 +date: 2019-03-26 title: "hugo check ulimit" slug: hugo_check_ulimit url: /commands/hugo_check_ulimit/ @@ -40,4 +40,4 @@ * [hugo check](/commands/hugo_check/) - Contains some verification checks -###### Auto generated by spf13/cobra on 30-Jan-2019 +###### Auto generated by spf13/cobra on 26-Mar-2019 diff -Nru hugo-0.54.0/docs/content/en/commands/hugo_config.md hugo-0.55.1/docs/content/en/commands/hugo_config.md --- hugo-0.54.0/docs/content/en/commands/hugo_config.md 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/docs/content/en/commands/hugo_config.md 2019-04-12 09:56:13.000000000 +0000 @@ -1,5 +1,5 @@ --- -date: 2019-01-30 +date: 2019-03-26 title: "hugo config" slug: hugo_config url: /commands/hugo_config/ @@ -40,4 +40,4 @@ * [hugo](/commands/hugo/) - hugo builds your site -###### Auto generated by spf13/cobra on 30-Jan-2019 +###### Auto generated by spf13/cobra on 26-Mar-2019 diff -Nru hugo-0.54.0/docs/content/en/commands/hugo_convert.md hugo-0.55.1/docs/content/en/commands/hugo_convert.md --- hugo-0.54.0/docs/content/en/commands/hugo_convert.md 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/docs/content/en/commands/hugo_convert.md 2019-04-12 09:56:13.000000000 +0000 @@ -1,5 +1,5 @@ --- -date: 2019-01-30 +date: 2019-03-26 title: "hugo convert" slug: hugo_convert url: /commands/hugo_convert/ @@ -43,4 +43,4 @@ * [hugo convert toTOML](/commands/hugo_convert_totoml/) - Convert front matter to TOML * [hugo convert toYAML](/commands/hugo_convert_toyaml/) - Convert front matter to YAML -###### Auto generated by spf13/cobra on 30-Jan-2019 +###### Auto generated by spf13/cobra on 26-Mar-2019 diff -Nru hugo-0.54.0/docs/content/en/commands/hugo_convert_toJSON.md hugo-0.55.1/docs/content/en/commands/hugo_convert_toJSON.md --- hugo-0.54.0/docs/content/en/commands/hugo_convert_toJSON.md 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/docs/content/en/commands/hugo_convert_toJSON.md 2019-04-12 09:56:13.000000000 +0000 @@ -1,5 +1,5 @@ --- -date: 2019-01-30 +date: 2019-03-26 title: "hugo convert toJSON" slug: hugo_convert_toJSON url: /commands/hugo_convert_tojson/ @@ -43,4 +43,4 @@ * [hugo convert](/commands/hugo_convert/) - Convert your content to different formats -###### Auto generated by spf13/cobra on 30-Jan-2019 +###### Auto generated by spf13/cobra on 26-Mar-2019 diff -Nru hugo-0.54.0/docs/content/en/commands/hugo_convert_toTOML.md hugo-0.55.1/docs/content/en/commands/hugo_convert_toTOML.md --- hugo-0.54.0/docs/content/en/commands/hugo_convert_toTOML.md 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/docs/content/en/commands/hugo_convert_toTOML.md 2019-04-12 09:56:13.000000000 +0000 @@ -1,5 +1,5 @@ --- -date: 2019-01-30 +date: 2019-03-26 title: "hugo convert toTOML" slug: hugo_convert_toTOML url: /commands/hugo_convert_totoml/ @@ -43,4 +43,4 @@ * [hugo convert](/commands/hugo_convert/) - Convert your content to different formats -###### Auto generated by spf13/cobra on 30-Jan-2019 +###### Auto generated by spf13/cobra on 26-Mar-2019 diff -Nru hugo-0.54.0/docs/content/en/commands/hugo_convert_toYAML.md hugo-0.55.1/docs/content/en/commands/hugo_convert_toYAML.md --- hugo-0.54.0/docs/content/en/commands/hugo_convert_toYAML.md 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/docs/content/en/commands/hugo_convert_toYAML.md 2019-04-12 09:56:13.000000000 +0000 @@ -1,5 +1,5 @@ --- -date: 2019-01-30 +date: 2019-03-26 title: "hugo convert toYAML" slug: hugo_convert_toYAML url: /commands/hugo_convert_toyaml/ @@ -43,4 +43,4 @@ * [hugo convert](/commands/hugo_convert/) - Convert your content to different formats -###### Auto generated by spf13/cobra on 30-Jan-2019 +###### Auto generated by spf13/cobra on 26-Mar-2019 diff -Nru hugo-0.54.0/docs/content/en/commands/hugo_env.md hugo-0.55.1/docs/content/en/commands/hugo_env.md --- hugo-0.54.0/docs/content/en/commands/hugo_env.md 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/docs/content/en/commands/hugo_env.md 2019-04-12 09:56:13.000000000 +0000 @@ -1,5 +1,5 @@ --- -date: 2019-01-30 +date: 2019-03-26 title: "hugo env" slug: hugo_env url: /commands/hugo_env/ @@ -39,4 +39,4 @@ * [hugo](/commands/hugo/) - hugo builds your site -###### Auto generated by spf13/cobra on 30-Jan-2019 +###### Auto generated by spf13/cobra on 26-Mar-2019 diff -Nru hugo-0.54.0/docs/content/en/commands/hugo_gen_autocomplete.md hugo-0.55.1/docs/content/en/commands/hugo_gen_autocomplete.md --- hugo-0.54.0/docs/content/en/commands/hugo_gen_autocomplete.md 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/docs/content/en/commands/hugo_gen_autocomplete.md 2019-04-12 09:56:13.000000000 +0000 @@ -1,5 +1,5 @@ --- -date: 2019-01-30 +date: 2019-03-26 title: "hugo gen autocomplete" slug: hugo_gen_autocomplete url: /commands/hugo_gen_autocomplete/ @@ -57,4 +57,4 @@ * [hugo gen](/commands/hugo_gen/) - A collection of several useful generators. -###### Auto generated by spf13/cobra on 30-Jan-2019 +###### Auto generated by spf13/cobra on 26-Mar-2019 diff -Nru hugo-0.54.0/docs/content/en/commands/hugo_gen_chromastyles.md hugo-0.55.1/docs/content/en/commands/hugo_gen_chromastyles.md --- hugo-0.54.0/docs/content/en/commands/hugo_gen_chromastyles.md 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/docs/content/en/commands/hugo_gen_chromastyles.md 2019-04-12 09:56:13.000000000 +0000 @@ -1,5 +1,5 @@ --- -date: 2019-01-30 +date: 2019-03-26 title: "hugo gen chromastyles" slug: hugo_gen_chromastyles url: /commands/hugo_gen_chromastyles/ @@ -44,4 +44,4 @@ * [hugo gen](/commands/hugo_gen/) - A collection of several useful generators. -###### Auto generated by spf13/cobra on 30-Jan-2019 +###### Auto generated by spf13/cobra on 26-Mar-2019 diff -Nru hugo-0.54.0/docs/content/en/commands/hugo_gen_doc.md hugo-0.55.1/docs/content/en/commands/hugo_gen_doc.md --- hugo-0.54.0/docs/content/en/commands/hugo_gen_doc.md 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/docs/content/en/commands/hugo_gen_doc.md 2019-04-12 09:56:13.000000000 +0000 @@ -1,5 +1,5 @@ --- -date: 2019-01-30 +date: 2019-03-26 title: "hugo gen doc" slug: hugo_gen_doc url: /commands/hugo_gen_doc/ @@ -46,4 +46,4 @@ * [hugo gen](/commands/hugo_gen/) - A collection of several useful generators. -###### Auto generated by spf13/cobra on 30-Jan-2019 +###### Auto generated by spf13/cobra on 26-Mar-2019 diff -Nru hugo-0.54.0/docs/content/en/commands/hugo_gen_man.md hugo-0.55.1/docs/content/en/commands/hugo_gen_man.md --- hugo-0.54.0/docs/content/en/commands/hugo_gen_man.md 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/docs/content/en/commands/hugo_gen_man.md 2019-04-12 09:56:13.000000000 +0000 @@ -1,5 +1,5 @@ --- -date: 2019-01-30 +date: 2019-03-26 title: "hugo gen man" slug: hugo_gen_man url: /commands/hugo_gen_man/ @@ -42,4 +42,4 @@ * [hugo gen](/commands/hugo_gen/) - A collection of several useful generators. -###### Auto generated by spf13/cobra on 30-Jan-2019 +###### Auto generated by spf13/cobra on 26-Mar-2019 diff -Nru hugo-0.54.0/docs/content/en/commands/hugo_gen.md hugo-0.55.1/docs/content/en/commands/hugo_gen.md --- hugo-0.54.0/docs/content/en/commands/hugo_gen.md 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/docs/content/en/commands/hugo_gen.md 2019-04-12 09:56:13.000000000 +0000 @@ -1,5 +1,5 @@ --- -date: 2019-01-30 +date: 2019-03-26 title: "hugo gen" slug: hugo_gen url: /commands/hugo_gen/ @@ -39,4 +39,4 @@ * [hugo gen doc](/commands/hugo_gen_doc/) - Generate Markdown documentation for the Hugo CLI. * [hugo gen man](/commands/hugo_gen_man/) - Generate man pages for the Hugo CLI -###### Auto generated by spf13/cobra on 30-Jan-2019 +###### Auto generated by spf13/cobra on 26-Mar-2019 diff -Nru hugo-0.54.0/docs/content/en/commands/hugo_import_jekyll.md hugo-0.55.1/docs/content/en/commands/hugo_import_jekyll.md --- hugo-0.54.0/docs/content/en/commands/hugo_import_jekyll.md 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/docs/content/en/commands/hugo_import_jekyll.md 2019-04-12 09:56:13.000000000 +0000 @@ -1,5 +1,5 @@ --- -date: 2019-01-30 +date: 2019-03-26 title: "hugo import jekyll" slug: hugo_import_jekyll url: /commands/hugo_import_jekyll/ @@ -42,4 +42,4 @@ * [hugo import](/commands/hugo_import/) - Import your site from others. -###### Auto generated by spf13/cobra on 30-Jan-2019 +###### Auto generated by spf13/cobra on 26-Mar-2019 diff -Nru hugo-0.54.0/docs/content/en/commands/hugo_import.md hugo-0.55.1/docs/content/en/commands/hugo_import.md --- hugo-0.54.0/docs/content/en/commands/hugo_import.md 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/docs/content/en/commands/hugo_import.md 2019-04-12 09:56:13.000000000 +0000 @@ -1,5 +1,5 @@ --- -date: 2019-01-30 +date: 2019-03-26 title: "hugo import" slug: hugo_import url: /commands/hugo_import/ @@ -38,4 +38,4 @@ * [hugo](/commands/hugo/) - hugo builds your site * [hugo import jekyll](/commands/hugo_import_jekyll/) - hugo import from Jekyll -###### Auto generated by spf13/cobra on 30-Jan-2019 +###### Auto generated by spf13/cobra on 26-Mar-2019 diff -Nru hugo-0.54.0/docs/content/en/commands/hugo_list_drafts.md hugo-0.55.1/docs/content/en/commands/hugo_list_drafts.md --- hugo-0.54.0/docs/content/en/commands/hugo_list_drafts.md 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/docs/content/en/commands/hugo_list_drafts.md 2019-04-12 09:56:13.000000000 +0000 @@ -1,5 +1,5 @@ --- -date: 2019-01-30 +date: 2019-03-26 title: "hugo list drafts" slug: hugo_list_drafts url: /commands/hugo_list_drafts/ @@ -40,4 +40,4 @@ * [hugo list](/commands/hugo_list/) - Listing out various types of content -###### Auto generated by spf13/cobra on 30-Jan-2019 +###### Auto generated by spf13/cobra on 26-Mar-2019 diff -Nru hugo-0.54.0/docs/content/en/commands/hugo_list_expired.md hugo-0.55.1/docs/content/en/commands/hugo_list_expired.md --- hugo-0.54.0/docs/content/en/commands/hugo_list_expired.md 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/docs/content/en/commands/hugo_list_expired.md 2019-04-12 09:56:13.000000000 +0000 @@ -1,5 +1,5 @@ --- -date: 2019-01-30 +date: 2019-03-26 title: "hugo list expired" slug: hugo_list_expired url: /commands/hugo_list_expired/ @@ -41,4 +41,4 @@ * [hugo list](/commands/hugo_list/) - Listing out various types of content -###### Auto generated by spf13/cobra on 30-Jan-2019 +###### Auto generated by spf13/cobra on 26-Mar-2019 diff -Nru hugo-0.54.0/docs/content/en/commands/hugo_list_future.md hugo-0.55.1/docs/content/en/commands/hugo_list_future.md --- hugo-0.54.0/docs/content/en/commands/hugo_list_future.md 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/docs/content/en/commands/hugo_list_future.md 2019-04-12 09:56:13.000000000 +0000 @@ -1,5 +1,5 @@ --- -date: 2019-01-30 +date: 2019-03-26 title: "hugo list future" slug: hugo_list_future url: /commands/hugo_list_future/ @@ -41,4 +41,4 @@ * [hugo list](/commands/hugo_list/) - Listing out various types of content -###### Auto generated by spf13/cobra on 30-Jan-2019 +###### Auto generated by spf13/cobra on 26-Mar-2019 diff -Nru hugo-0.54.0/docs/content/en/commands/hugo_list.md hugo-0.55.1/docs/content/en/commands/hugo_list.md --- hugo-0.54.0/docs/content/en/commands/hugo_list.md 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/docs/content/en/commands/hugo_list.md 2019-04-12 09:56:13.000000000 +0000 @@ -1,5 +1,5 @@ --- -date: 2019-01-30 +date: 2019-03-26 title: "hugo list" slug: hugo_list url: /commands/hugo_list/ @@ -41,4 +41,4 @@ * [hugo list expired](/commands/hugo_list_expired/) - List all posts already expired * [hugo list future](/commands/hugo_list_future/) - List all posts dated in the future -###### Auto generated by spf13/cobra on 30-Jan-2019 +###### Auto generated by spf13/cobra on 26-Mar-2019 diff -Nru hugo-0.54.0/docs/content/en/commands/hugo.md hugo-0.55.1/docs/content/en/commands/hugo.md --- hugo-0.54.0/docs/content/en/commands/hugo.md 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/docs/content/en/commands/hugo.md 2019-04-12 09:56:13.000000000 +0000 @@ -1,5 +1,5 @@ --- -date: 2019-01-30 +date: 2019-03-26 title: "hugo" slug: hugo url: /commands/hugo/ @@ -49,14 +49,15 @@ --minify minify any supported output format (HTML, XML etc.) --noChmod don't sync permission mode of files --noTimes don't sync modification time of files + --path-warnings print warnings on duplicate target paths etc. --quiet build in quiet mode --renderToMemory render to memory (only useful for benchmark testing) -s, --source string filesystem path to read files relative from - --stepAnalysis display memory and timing of different steps of the program --templateMetrics display metrics about template executions --templateMetricsHints calculate some improvement hints when combined with --templateMetrics -t, --theme strings themes to use (located in /themes/THEMENAME/) --themesDir string filesystem path to themes directory + --trace file write trace to file (not useful in general) -v, --verbose verbose output --verboseLog verbose logging -w, --watch watch filesystem for changes and recreate as needed @@ -75,4 +76,4 @@ * [hugo server](/commands/hugo_server/) - A high performance webserver * [hugo version](/commands/hugo_version/) - Print the version number of Hugo -###### Auto generated by spf13/cobra on 30-Jan-2019 +###### Auto generated by spf13/cobra on 26-Mar-2019 diff -Nru hugo-0.54.0/docs/content/en/commands/hugo_new.md hugo-0.55.1/docs/content/en/commands/hugo_new.md --- hugo-0.54.0/docs/content/en/commands/hugo_new.md 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/docs/content/en/commands/hugo_new.md 2019-04-12 09:56:13.000000000 +0000 @@ -1,5 +1,5 @@ --- -date: 2019-01-30 +date: 2019-03-26 title: "hugo new" slug: hugo_new url: /commands/hugo_new/ @@ -48,12 +48,13 @@ --minify minify any supported output format (HTML, XML etc.) --noChmod don't sync permission mode of files --noTimes don't sync modification time of files + --path-warnings print warnings on duplicate target paths etc. -s, --source string filesystem path to read files relative from - --stepAnalysis display memory and timing of different steps of the program --templateMetrics display metrics about template executions --templateMetricsHints calculate some improvement hints when combined with --templateMetrics -t, --theme strings themes to use (located in /themes/THEMENAME/) --themesDir string filesystem path to themes directory + --trace file write trace to file (not useful in general) ``` ### Options inherited from parent commands @@ -75,4 +76,4 @@ * [hugo new site](/commands/hugo_new_site/) - Create a new site (skeleton) * [hugo new theme](/commands/hugo_new_theme/) - Create a new theme -###### Auto generated by spf13/cobra on 30-Jan-2019 +###### Auto generated by spf13/cobra on 26-Mar-2019 diff -Nru hugo-0.54.0/docs/content/en/commands/hugo_new_site.md hugo-0.55.1/docs/content/en/commands/hugo_new_site.md --- hugo-0.54.0/docs/content/en/commands/hugo_new_site.md 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/docs/content/en/commands/hugo_new_site.md 2019-04-12 09:56:13.000000000 +0000 @@ -1,5 +1,5 @@ --- -date: 2019-01-30 +date: 2019-03-26 title: "hugo new site" slug: hugo_new_site url: /commands/hugo_new_site/ @@ -44,4 +44,4 @@ * [hugo new](/commands/hugo_new/) - Create new content for your site -###### Auto generated by spf13/cobra on 30-Jan-2019 +###### Auto generated by spf13/cobra on 26-Mar-2019 diff -Nru hugo-0.54.0/docs/content/en/commands/hugo_new_theme.md hugo-0.55.1/docs/content/en/commands/hugo_new_theme.md --- hugo-0.54.0/docs/content/en/commands/hugo_new_theme.md 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/docs/content/en/commands/hugo_new_theme.md 2019-04-12 09:56:13.000000000 +0000 @@ -1,5 +1,5 @@ --- -date: 2019-01-30 +date: 2019-03-26 title: "hugo new theme" slug: hugo_new_theme url: /commands/hugo_new_theme/ @@ -43,4 +43,4 @@ * [hugo new](/commands/hugo_new/) - Create new content for your site -###### Auto generated by spf13/cobra on 30-Jan-2019 +###### Auto generated by spf13/cobra on 26-Mar-2019 diff -Nru hugo-0.54.0/docs/content/en/commands/hugo_server.md hugo-0.55.1/docs/content/en/commands/hugo_server.md --- hugo-0.54.0/docs/content/en/commands/hugo_server.md 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/docs/content/en/commands/hugo_server.md 2019-04-12 09:56:13.000000000 +0000 @@ -1,5 +1,5 @@ --- -date: 2019-01-30 +date: 2019-03-26 title: "hugo server" slug: hugo_server url: /commands/hugo_server/ @@ -60,14 +60,15 @@ --noChmod don't sync permission mode of files --noHTTPCache prevent HTTP caching --noTimes don't sync modification time of files + --path-warnings print warnings on duplicate target paths etc. -p, --port int port on which the server will listen (default 1313) --renderToDisk render to Destination path (default is render to memory & serve from there) -s, --source string filesystem path to read files relative from - --stepAnalysis display memory and timing of different steps of the program --templateMetrics display metrics about template executions --templateMetricsHints calculate some improvement hints when combined with --templateMetrics -t, --theme strings themes to use (located in /themes/THEMENAME/) --themesDir string filesystem path to themes directory + --trace file write trace to file (not useful in general) -w, --watch watch filesystem for changes and recreate as needed (default true) ``` @@ -88,4 +89,4 @@ * [hugo](/commands/hugo/) - hugo builds your site -###### Auto generated by spf13/cobra on 30-Jan-2019 +###### Auto generated by spf13/cobra on 26-Mar-2019 diff -Nru hugo-0.54.0/docs/content/en/commands/hugo_version.md hugo-0.55.1/docs/content/en/commands/hugo_version.md --- hugo-0.54.0/docs/content/en/commands/hugo_version.md 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/docs/content/en/commands/hugo_version.md 2019-04-12 09:56:13.000000000 +0000 @@ -1,5 +1,5 @@ --- -date: 2019-01-30 +date: 2019-03-26 title: "hugo version" slug: hugo_version url: /commands/hugo_version/ @@ -39,4 +39,4 @@ * [hugo](/commands/hugo/) - hugo builds your site -###### Auto generated by spf13/cobra on 30-Jan-2019 +###### Auto generated by spf13/cobra on 26-Mar-2019 diff -Nru hugo-0.54.0/docs/content/en/content-management/cross-references.md hugo-0.55.1/docs/content/en/content-management/cross-references.md --- hugo-0.54.0/docs/content/en/content-management/cross-references.md 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/docs/content/en/content-management/cross-references.md 2019-04-12 09:56:13.000000000 +0000 @@ -76,7 +76,7 @@ The behaviour can, since Hugo 0.45, be configured in `config.toml`: refLinksErrorLevel ("ERROR") -: When using `ref` or `relref` to resolve page links and a link cannot resolved, it will be logged with this logg level. Valid values are `ERROR` (default) or `WARNING`. Any `ERROR` will fail the build (`exit -1`). +: When using `ref` or `relref` to resolve page links and a link cannot resolved, it will be logged with this log level. Valid values are `ERROR` (default) or `WARNING`. Any `ERROR` will fail the build (`exit -1`). refLinksNotFoundURL : URL to be used as a placeholder when a page reference cannot be found in `ref` or `relref`. Is used as-is. diff -Nru hugo-0.54.0/docs/content/en/content-management/front-matter.md hugo-0.55.1/docs/content/en/content-management/front-matter.md --- hugo-0.54.0/docs/content/en/content-management/front-matter.md 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/docs/content/en/content-management/front-matter.md 2019-04-12 09:56:13.000000000 +0000 @@ -111,6 +111,9 @@ slug : appears as the tail of the output URL. A value specified in front matter will override the segment of the URL based on the filename. +summary +: text used when providing a summary of the article in the `.Summary` page variable; details available in the [content-summaries](/content-management/summaries/) section. + title : the title for the content. diff -Nru hugo-0.54.0/docs/content/en/content-management/multilingual.md hugo-0.55.1/docs/content/en/content-management/multilingual.md --- hugo-0.54.0/docs/content/en/content-management/multilingual.md 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/docs/content/en/content-management/multilingual.md 2019-04-12 09:56:13.000000000 +0000 @@ -49,7 +49,7 @@ help = "Aide" {{< /code-toggle >}} -Anything not defined in a `[languages]` block will fall back to the global value for that key (e.g., `copyright` for the English [`en`] language). This also works for `params`, as demonstrated witgh `help` above: You will get the value `Aide` in French and `Help` in all the languages without this parameter set. +Anything not defined in a `[languages]` block will fall back to the global value for that key (e.g., `copyright` for the English [`en`] language). This also works for `params`, as demonstrated with `help` above: you will get the value `Aide` in French and `Help` in all the languages without this parameter set. With the configuration above, all content, sitemap, RSS feeds, paginations, and taxonomy pages will be rendered below `/` in English (your default content language) and then below `/fr` in French. diff -Nru hugo-0.54.0/docs/content/en/content-management/shortcodes.md hugo-0.55.1/docs/content/en/content-management/shortcodes.md --- hugo-0.54.0/docs/content/en/content-management/shortcodes.md 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/docs/content/en/content-management/shortcodes.md 2019-04-12 09:56:13.000000000 +0000 @@ -243,7 +243,7 @@ ### `param` -Gets a value from the current `Page's` params set in front matter, with a fall back to the site param value. If will log an `ERROR` if the param with the given key could not be found in either. +Gets a value from the current `Page's` params set in front matter, with a fall back to the site param value. It will log an `ERROR` if the param with the given key could not be found in either. ```bash {{}} @@ -372,7 +372,7 @@ {{}} {{< /code >}} -Furthermore, you can automatically start playback of the embedded video by setting the `autoplay` parameter to `true`. Remember that you can't mix named an unnamed parameters, so you'll need to assign the yet unnamed video id to the parameter `id`: +Furthermore, you can automatically start playback of the embedded video by setting the `autoplay` parameter to `true`. Remember that you can't mix named and unnamed parameters, so you'll need to assign the yet unnamed video id to the parameter `id`: {{< code file="example-youtube-input-with-autoplay.md" >}} diff -Nru hugo-0.54.0/docs/content/en/content-management/summaries.md hugo-0.55.1/docs/content/en/content-management/summaries.md --- hugo-0.54.0/docs/content/en/content-management/summaries.md 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/docs/content/en/content-management/summaries.md 2019-04-12 09:56:13.000000000 +0000 @@ -23,6 +23,7 @@ * Automatic Summary Split * Manual Summary Split +* Front Matter Summary It is natural to accompany the summary with links to the original content, and a common design pattern is to see this link in the form of a "Read More ..." button. See the `.RelPermalink`, `.Permalink`, and `.Truncated` [page variables][pagevariables]. @@ -60,6 +61,28 @@ Be careful to enter <!--more--> exactly; i.e., all lowercase and with no whitespace. {{% /warning %}} +### Front Matter Summary + +You might want your summary to be something other than the text that starts the article. In this case you can provide a separate summary in the `summary` variable of the article front matter. + +Pros +: Complete freedom of text independent of the content of the article. Markup can be used within the summary. + +Cons +: Extra work for content authors as they need to write an entirely separate piece of text as the summary of the article. + +## Summary Selection Order + +Because there are multiple ways in which a summary can be specified it is useful to understand the order of selection Hugo follows when deciding on the text to be returned by `.Summary`. It is as follows: + +1. If there is a <!--more--> summary divider present in the article the text up to the divider will be provided as per the manual summary split method +2. If there is a `summary` variable in the article front matter the value of the variable will be provided as per the front matter summary method +3. The text at the start of the article will be provided as per the automatic summary split method + +{{% warning "Competing selections" %}} +Hugo uses the _first_ of the above steps that returns text. So if, for example, your article has both `summary` variable in its front matter and a <!--more--> summary divider Hugo will use the manual summary split method. +{{% /warning %}} + ## Example: First 10 Articles with Summaries You can show content summaries with the following code. You could use the following snippet, for example, in a [section template][]. diff -Nru hugo-0.54.0/docs/content/en/content-management/toc.md hugo-0.55.1/docs/content/en/content-management/toc.md --- hugo-0.54.0/docs/content/en/content-management/toc.md 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/docs/content/en/content-management/toc.md 2019-04-12 09:56:13.000000000 +0000 @@ -89,7 +89,7 @@ {{% /note %}} [conditionals]: /templates/introduction/#conditionals -[front matter]: /content-management/table-of-contents/ +[front matter]: /content-management/front-matter/ [pagevars]: /variables/page/ [partials]: /templates/partials/ [single page template]: /templates/single-page-templates/ diff -Nru hugo-0.54.0/docs/content/en/content-management/urls.md hugo-0.55.1/docs/content/en/content-management/urls.md --- hugo-0.54.0/docs/content/en/content-management/urls.md 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/docs/content/en/content-management/urls.md 2019-04-12 09:56:13.000000000 +0000 @@ -82,9 +82,13 @@ ## Aliases -For people migrating existing published content to Hugo, there's a good chance you need a mechanism to handle redirecting old URLs. +Aliases can be used to create redirects to your page from other URLs. -Luckily, redirects can be handled easily with **aliases** in Hugo. + +Aliases comes in two forms: + +1. Starting with a `/` meaning they are relative to the `BaseURL`, e.g. `/posts/my-blogpost/` +2. They are relative to the `Page` they're defined in, e.g. `my-blogpost` or even something like `../blog/my-blogpost` (new in Hugo 0.55). ### Example: Aliases diff -Nru hugo-0.54.0/docs/content/en/contribute/development.md hugo-0.55.1/docs/content/en/contribute/development.md --- hugo-0.54.0/docs/content/en/contribute/development.md 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/docs/content/en/contribute/development.md 2019-04-12 09:56:13.000000000 +0000 @@ -52,7 +52,7 @@ You should see something similar to the following written to the console. Note that the version here reflects the most recent version of Go as of the last update for this page: ``` -go version go1.8 darwin/amd64 +go version go1.12 darwin/amd64 ``` Next, make sure that you set up your `GOPATH` [as described in the installation guide][setupgopath]. @@ -116,8 +116,8 @@ Confirm the installation: ``` -git version 2.6.3 -hub version 2.2.2 +git version 2.21.0 +hub version 2.10.0 ``` ## Set up your working copy @@ -132,16 +132,29 @@ We're going to clone the [master Hugo repository](https://github.com/gohugoio/hugo). That seems counter-intuitive, since you won't have commit rights on it. But it's required for the Go workflow. You'll work on a copy of the master and push your changes to your own repository on GitHub. -So, let's clone that master repository: +So, let's make a new directory and clone that master repository: ``` -go get -v -u github.com/gohugoio/hugo +mkdir $HOME/src +cd $HOME/src +git clone https://github.com/gohugoio/hugo.git ``` -Hugo relies on [Testify](https://github.com/stretchr/testify) for testing Go code. If you don't already have it, get the Testify testing tools: +> Since Hugo 0.48, Hugo uses the Go Modules support built into Go 1.11 to build. +> The easiest is to clone Hugo in a directory outside of GOPATH + +And then, install dependencies of Hugo by running the following in the cloned directory: + +``` +cd $HOME/src/hugo +go install +``` + + +Hugo relies on [mage](github.com/magefile/mage) for some convenient build and test targets. If you don't already have it, get it: ``` -go get github.com/stretchr/testify +go get github.com/magefile/mage ``` ### Fork the repository @@ -163,7 +176,7 @@ Switch back to the terminal and move into the directory of the cloned master repository from the last step. ``` -cd $GOPATH/src/github.com/gohugoio/hugo +cd $HOME/src/hugo ``` Now Git needs to know that our fork exists by adding the copied remote url: @@ -233,19 +246,33 @@ While making changes in the codebase it's a good idea to build the binary to test them: ``` -go build -o hugo main.go +mage hugo +``` + +This command generates the binary file at the root of the repository. + +If you want to install the binary in `$GOPATH/bin`, run + +``` +mage install ``` ### Test Sometimes changes on the codebase can cause unintended side effects. Or they don't work as expected. Most functions have their own test cases. You can find them in files ending with `_test.go`. -Make sure the commands `go test ./...` passes, and `go build` completes. +Make sure the commands + +``` +mage -v check +``` + +passes. ### Formatting The Go code styleguide maybe is opinionated but it ensures that the codebase looks the same, regardless who wrote the code. Go comes with its own formatting tool. Let's apply the styleguide to our additions: ``` -go fmt ./... +mage fmt ``` Once you made your additions commit your changes. Make sure that you follow our [code contribution guidelines](https://github.com/gohugoio/hugo/blob/master/CONTRIBUTING.md): diff -Nru hugo-0.54.0/docs/content/en/contribute/themes.md hugo-0.55.1/docs/content/en/contribute/themes.md --- hugo-0.54.0/docs/content/en/contribute/themes.md 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/docs/content/en/contribute/themes.md 2019-04-12 09:56:13.000000000 +0000 @@ -30,7 +30,7 @@ 4. Add a descriptive `README.md` to the root of the theme source 5. Add `/images/screenshot.png` and `/images/tn.png` -\* If your theme doesn't fit into the `Hugo Basic Example` site, we encourage theme authors to supply a self-contained Hugo site in `/exampleSite`. +\* If your theme doesn't fit into the `Hugo Basic Example` site, we encourage theme authors to supply a self-contained Hugo site in `/exampleSite/`, but note that for security reasons the content directory on the Hugo showcase will still be published from the [`Hugo Basic Example`](https://github.com/gohugoio/hugoBasicExample/tree/master/content) repository. {{% note %}} The folder name here---`exampleSite`---is important, as this folder will be picked up and used by the script that generates the Hugo Theme Site. It mirrors the root directory of a Hugo website and allows you to add custom content, assets, and a `config` file with preset values. @@ -125,22 +125,7 @@ Your theme's README file should be written in markdown and saved at the root of your theme's directory structure. Your `README.md` serves as 1. Content for your theme's details page at -2. General information about the theme in your GitHub repository (i.e., it's usual purpose) - -#### Example `README.md` - -You can download the following `README.md` as an outline: - -{{< code file="README.md" download="README.md" >}} - -# Theme Title - -**Need input from @digitalcraftsman on what could be added to this file.** - - - - -{{< /code >}} +2. General information about the theme in your GitHub repository (i.e., it's usual purpose, features and instructions) {{% note "Screenshots in your `README.md`"%}} If you add screenshots to the README, please make use of absolute file paths instead of relative ones like `/images/screenshot.png`. Relative paths work great on GitHub but they don't correspond to the directory structure of [themes.gohugo.io](http://themes.gohugo.io/). Therefore, browsers will not be able to display screenshots on the theme site under the given (relative) path. diff -Nru hugo-0.54.0/docs/content/en/getting-started/configuration.md hugo-0.55.1/docs/content/en/getting-started/configuration.md --- hugo-0.54.0/docs/content/en/getting-started/configuration.md 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/docs/content/en/getting-started/configuration.md 2019-04-12 09:56:13.000000000 +0000 @@ -114,6 +114,9 @@ defaultContentLanguageInSubdir (false) : Render the default content language in subdir, e.g. `content/en/`. The site root `/` will then redirect to `/en/`. +disableAliases (false) +: Will disable generation of alias redirects. Note that even if `disableAliases` is set, the aliases themselves are preserved on the page. The motivation with this is to be able to generate 301 redirects in an `.htacess`, a Netlify `_redirects` file or similar using a custom output format. + disableHugoGeneratorInject (false) : Hugo will, by default, inject a generator meta tag in the HTML head on the _home page only_. You can turn it off, but we would really appreciate if you don't, as this is a good way to watch Hugo's popularity on the rise. @@ -251,7 +254,7 @@ : Display memory and timing of different steps of the program. summaryLength (70) -: The length of text to show in a [`.Summary`](/content-management/summaries/#hugo-defined-automatic-summary-splitting). +: The length of text in words to show in a [`.Summary`](/content-management/summaries/#hugo-defined-automatic-summary-splitting). taxonomies : See [Configure Taxonomies](/content-management/taxonomies#configure-taxonomies). @@ -294,6 +297,11 @@ ``` {{% /note %}} +## Configuration Environment Variables + +HUGO_NUMWORKERMULTIPLIER +: Can be set to increase or reduce the number of workers used in parallel processing in Hugo. If not set, the number of logical CPUs will be used. + ## Configuration Lookup Order Similar to the template [lookup order][], Hugo has a default set of rules for searching for a configuration file in the root of your website's source directory as a default behavior: diff -Nru hugo-0.54.0/docs/content/en/getting-started/quick-start.md hugo-0.55.1/docs/content/en/getting-started/quick-start.md --- hugo-0.54.0/docs/content/en/getting-started/quick-start.md 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/docs/content/en/getting-started/quick-start.md 2019-04-12 09:56:13.000000000 +0000 @@ -43,7 +43,7 @@ ``` -{{< asciicast HDlKrUrbfT7yiWsbd6QoxzRTN >}} +{{< asciicast ItACREbFgvJ0HjnSNeTknxWy9 >}} ## Step 2: Create a New Site @@ -54,7 +54,7 @@ The above will create a new Hugo site in a folder named `quickstart`. -{{< asciicast 1PH9A2fs14Dnyarx5v8OMYQer >}} +{{< asciicast 3mf1JGaN0AX0Z7j5kLGl3hSh8 >}} ## Step 3: Add a Theme @@ -81,7 +81,7 @@ ``` -{{< asciicast WJM2LEZQs8VRhNeuZ5NiGPp9I >}} +{{< asciicast 7naKerRYUGVPj8kiDmdh5k5h9 >}} ## Step 4: Add Some Content @@ -89,6 +89,8 @@ hugo new posts/my-first-post.md ``` +{{< asciicast eUojYCfRTZvkEiqc52fUsJRBR >}} + Edit the newly created content file if you want. @@ -97,23 +99,30 @@ Now, start the Hugo server with [drafts](/getting-started/usage/#draft-future-and-expired-content) enabled: +{{< asciicast BvJBsF6egk9c163bMsObhuNXj >}} + + + ``` ▶ hugo server -D -Started building sites ... -Built site for language en: -1 of 1 draft rendered -0 future content -0 expired content -1 regular pages created -8 other pages created -0 non-page files copied -1 paginator pages created -0 categories created -0 tags created -total in 18 ms -Watching for changes in /Users/bep/sites/quickstart/{data,content,layouts,static,themes} + | EN ++------------------+----+ + Pages | 10 + Paginator pages | 0 + Non-page files | 0 + Static files | 3 + Processed images | 0 + Aliases | 1 + Sitemaps | 1 + Cleaned | 0 + +Total in 11 ms +Watching for changes in /Users/bep/quickstart/{content,data,layouts,static,themes} +Watching for config changes in /Users/bep/quickstart/config.toml +Environment: "development" Serving pages from memory +Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender Web Server is available at http://localhost:1313/ (bind address 127.0.0.1) Press Ctrl+C to stop ``` @@ -148,6 +157,3 @@ **For further theme customization, see [Customize a Theme](/themes/customizing/).** -## Recapitulation - -{{< asciicast pWp4uvyAkdWgQllD9RCfeBL5k >}} diff -Nru hugo-0.54.0/docs/content/en/hosting-and-deployment/hosting-on-aws-amplify.md hugo-0.55.1/docs/content/en/hosting-and-deployment/hosting-on-aws-amplify.md --- hugo-0.54.0/docs/content/en/hosting-and-deployment/hosting-on-aws-amplify.md 1970-01-01 00:00:00.000000000 +0000 +++ hugo-0.55.1/docs/content/en/hosting-and-deployment/hosting-on-aws-amplify.md 2019-04-12 09:56:13.000000000 +0000 @@ -0,0 +1,43 @@ +--- +title: Host on AWS Amplify +linktitle: Host on AWS Amplify +description: Develop and deploy a cloud-powered web app with AWS Amplify. +date: 2018-01-31 +publishdate: 2018-01-31 +lastmod: 2018-01-31 +categories: [hosting and deployment] +keywords: [amplify,hosting,deployment] +authors: [Nikhil Swaminathan] +menu: + docs: + parent: "hosting-and-deployment" + weight: 10 +weight: 10 +sections_weight: 10 +draft: false +aliases: [] +toc: true +--- + +In this guide we'll walk through how to deploy and host your Hugo site using the [AWS Amplify Console](https://console.amplify.aws). + +AWS Amplify is a combination of client library, CLI toolchain, and a Console for continuous deployment and hosting. The Amplify CLI and library allow developers to get up & running with full-stack cloud-powered applications with features like authentication, storage, serverless GraphQL or REST APIs, analytics, Lambda functions, & more. The Amplify Console provides continuous deployment and hosting for modern web apps (single page apps and static site generators). Continuous deployment allows developers to deploy updates to their web app on every code commit to their Git repository. Hosting includes features such as globally available CDNs, easy custom domain setup + HTTPS, feature branch deployments, and password protection. + +## Pre-requisites + +* [Sign up for an AWS Account](https://portal.aws.amazon.com/billing/signup?redirect_url=https%3A%2F%2Faws.amazon.com%2Fregistration-confirmation). There are no upfront charges or any term commitments to create an AWS account and signing up gives you immediate access to the AWS Free Tier. +* You have an account with GitHub, GitLab, or Bitbucket. +* You have completed the [Quick Start][] or have a Hugo website you are ready to deploy and share with the world. + +## Hosting + +1. Log in to the [AWS Amplify Console](https://console.aws.amazon.com/amplify/home) and choose Get Started under Deploy. + ![Hugo Amplify](/images/hosting-and-deployment/hosting-on-aws-amplify/amplify-gettingstarted.png) + +1. Connect a branch from your GitHub, Bitbucket, GitLab, or AWS CodeCommit repository. Connecting your repository allows Amplify to deploy updates on every code commit to a branch. + ![Hugo Amplify](/images/hosting-and-deployment/hosting-on-aws-amplify/amplify-connect-repo.gif) + +1. Accept the default build settings. The Amplify Console automatically detects your Hugo build settings and output directory. + ![Hugo Amplify](/images/hosting-and-deployment/hosting-on-aws-amplify/amplify-build-settings.png) + +1. Review your changes and then choose **Save and deploy**. The Amplify Console will pull code from your repository, build changes to the backend and frontend, and deploy your build artifacts at `https://master.unique-id.amplifyapp.com`. Bonus: Screenshots of your app on different devices to find layout issues. \ No newline at end of file diff -Nru hugo-0.54.0/docs/content/en/hugo-pipes/fingerprint.md hugo-0.55.1/docs/content/en/hugo-pipes/fingerprint.md --- hugo-0.54.0/docs/content/en/hugo-pipes/fingerprint.md 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/docs/content/en/hugo-pipes/fingerprint.md 2019-04-12 09:56:13.000000000 +0000 @@ -18,7 +18,7 @@ Fingerprinting and [SRI](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity) can be applied to any asset file using `resources.Fingerpint` which takes two arguments, the resource object and a [hash function](https://en.wikipedia.org/wiki/Cryptographic_hash_function). -The default hash function is `sha256`. Other available functions are `sha512` and `md5`. +The default hash function is `sha256`. Other available functions are `sha384` (from Hugo `0.55`), `sha512` and `md5`. Any so processed asset will bear a `.Data.Integrity` property containing an integrity string, which is made up of the name of the hash function, one hyphen and the base64-encoded hash sum. diff -Nru hugo-0.54.0/docs/content/en/_index.md hugo-0.55.1/docs/content/en/_index.md --- hugo-0.54.0/docs/content/en/_index.md 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/docs/content/en/_index.md 2019-04-12 09:56:13.000000000 +0000 @@ -32,7 +32,7 @@ tagline: HTML not enough? copy: Hugo allows you to output your content in multiple formats, including JSON or AMP, and makes it easy to create your own. sections: - - heading: "100s of Themes" + - heading: "300+ Themes" cta: Check out the Hugo themes. link: http://themes.gohugo.io/ color_classes: bg-accent-color white diff -Nru hugo-0.54.0/docs/content/en/news/0.16-relnotes/index.md hugo-0.55.1/docs/content/en/news/0.16-relnotes/index.md --- hugo-0.54.0/docs/content/en/news/0.16-relnotes/index.md 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/docs/content/en/news/0.16-relnotes/index.md 2019-04-12 09:56:13.000000000 +0000 @@ -100,16 +100,13 @@ `PygmentsCodeFencesGuessSyntax = true` {{}} * Make `ByCount` sort consistently {{}} * Add `Scratch` to shortcode {{}} -* Add support for symbolic links for content, layout, static, theme {{}} -* Add '+' as one of the valid characters in URLs specified in the front matter - {{}} -* Make alias redirect output URLs relative when `RelativeURLs = true` {{}} -* Hugo injects meta generator tag on homepage if missing {{}} +* Add support for symbolic links for content, layout, static, theme {{}} +* Add '+' as one of the valid characters in URLs specified in the front matter {{}} +* Make alias redirect output URLs relative when `RelativeURLs = true` {{}} +* Hugo injects meta generator tag on homepage if missing {{}} ### Fixes + * Fix file change watcher for TextMate 2 and friends on OS X {{}} * Make dynamic reloading of config file reliable on all platform {{}} * Hugo now works on Linux/arm64 {{}} Binary files /tmp/tmp98pLlf/8kpyHFjUd6/hugo-0.54.0/docs/content/en/news/0.54.0-relnotes/featured-hugo-54.0-poster.png and /tmp/tmp98pLlf/owPkQYg8h2/hugo-0.55.1/docs/content/en/news/0.54.0-relnotes/featured-hugo-54.0-poster.png differ diff -Nru hugo-0.54.0/docs/content/en/news/0.54.0-relnotes/index.md hugo-0.55.1/docs/content/en/news/0.54.0-relnotes/index.md --- hugo-0.54.0/docs/content/en/news/0.54.0-relnotes/index.md 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/docs/content/en/news/0.54.0-relnotes/index.md 2019-04-12 09:56:13.000000000 +0000 @@ -1,15 +1,12 @@ --- date: 2019-02-01 -title: "0.54.0" -description: "0.54.0" +title: "0.54.0: Mostly Bugfixes" +description: "0.54.0 is mostly a bugfix-release, but also some nice improvements." categories: ["Releases"] -images: -- images/blog/hugo-bug-poster.png --- - This release represents **27 contributions by 7 contributors** to the main Hugo code base. [@bep](https://github.com/bep) leads the Hugo development with a significant amount of contributions, but also a big shoutout to [@tryzniak](https://github.com/tryzniak), [@anthonyfok](https://github.com/anthonyfok), and [@mywaiting](https://github.com/mywaiting) for their ongoing contributions. And a big thanks to [@digitalcraftsman](https://github.com/digitalcraftsman) and [@onedrawingperday](https://github.com/onedrawingperday) for their relentless work on keeping the themes site in pristine condition and to [@kaushalmodi](https://github.com/kaushalmodi) for his great work on the documentation site. Many have also been busy writing and fixing the documentation in [hugoDocs](https://github.com/gohugoio/hugoDocs), which has received **38 contributions by 17 contributors**. A special thanks to [@bep](https://github.com/bep), [@kaushalmodi](https://github.com/kaushalmodi), [@onedrawingperday](https://github.com/onedrawingperday), and [@peaceiris](https://github.com/peaceiris) for their work on the documentation site. Binary files /tmp/tmp98pLlf/8kpyHFjUd6/hugo-0.54.0/docs/content/en/news/0.55.0-relnotes/featured.png and /tmp/tmp98pLlf/owPkQYg8h2/hugo-0.55.1/docs/content/en/news/0.55.0-relnotes/featured.png differ diff -Nru hugo-0.54.0/docs/content/en/news/0.55.0-relnotes/index.md hugo-0.55.1/docs/content/en/news/0.55.0-relnotes/index.md --- hugo-0.54.0/docs/content/en/news/0.55.0-relnotes/index.md 1970-01-01 00:00:00.000000000 +0000 +++ hugo-0.55.1/docs/content/en/news/0.55.0-relnotes/index.md 2019-04-12 09:56:13.000000000 +0000 @@ -0,0 +1,194 @@ + +--- +date: 2019-04-08 +title: "Hugo 0.55.0: The early Easter Egg Edition!" +description: "Faster, virtualized Output Formats, revised shortcodes, new return keyword, and much more …" +categories: ["Releases"] +--- + +Hugo `0.55` is **the early Easter Egg Edition** with lots of great improvements and fixes. The original motivation for this release was to prepare for [Issue #5074](https://github.com/gohugoio/hugo/issues/5074), but the structural changes needed for that paved the way for lots of others. Please study the list of changes below, and especially the **Notes** section, but some headlines include: + +## Virtualized Output Formats + +[Custom Output Formats](https://gohugo.io/templates/output-formats) has been a really useful feature, but it has had some annoying and not so obvious restrictions that are now lifted. Now all `Page` collections are aware of the output format being rendered. This means, to give some examples, that: + +* In a `RSS` template, listing pages with their content will use output format specific shortcode templates even if the pages themselves are not configured to output to that output format. +* Using `.Render` when looping over a `Page` collection will now work as expected. +* Every Output Format can be paginated. + +We have now also added a new `Permalinkable` configuration attribute, which is enabled by default for `HTML` and `AMP`. + +## Shortcodes Revised + +Shortcodes using the `{{%/* */%}}` as the outer-most delimiter will now be fully rendered when sent to the content renderer (e.g. Blackfriday for Markdown), meaning they can be part of the generated table of contents, footnotes, etc. + +If you want the old behavior, you can put the following line in the start of your shortcode template: + +``` +{{ $_hugo_config := `{ "version": 1 }` }} +``` + +But using the `{{}}` delimiter will, in most cases, be a better alternative, possibly in combination with the `markdownify` template func. + +See [#5763](https://github.com/gohugoio/hugo/issues/5763). + +## New Return Keyword for Partials + +Hugo's `partial` and `partialCached` are great for template macros. With the new `return` keyword you can write partials as proper functions that can return any type: + +```go-html-template +{{ $v := add . 42 }} +{{ return $v }} +``` + +See [#5783](https://github.com/gohugoio/hugo/issues/5783). + +## .Page on Taxonomy nodes + +The taxonomy nodes now have a `.Page` accessor which makes it much simpler to get a proper `.Title` etc. This means that older and clumsy constructs can be simplified. Some examples: + +```go-html-template +
    + {{ range .Data.Terms.Alphabetical }} +
  • {{ .Page.Title }} {{ .Count }}
  • + {{ end }} +
+``` + +```go-html-template + +``` + +See [#5719](https://github.com/gohugoio/hugo/issues/5719). + +## And it's Faster! + +This version is also the **fastest to date**. A site building benchmark shows more than 10% decrease in both build time and memory consumption, but that depends on the site. It’s quite a challenge to consistently add significant new functionality and simultaneously improve performance. Also, note that we are now more honest about build times reported (`Total in 1234 ms`). We now do all initialization in the `Build` step, so you may get a higher time reported if you, as an example, have `--enableGitInfo` enabled, which now is included in the reported time. + +![Benchmark](https://pbs.twimg.com/media/D3kGYiMXsAUjYxS.png) + +## Thanks! + +This release represents **59 contributions by 10 contributors** to the main Hugo code base. +[@bep](https://github.com/bep) leads the Hugo development with a significant amount of contributions, but also a big shoutout to [@mcdee](https://github.com/mcdee), [@quasilyte](https://github.com/quasilyte), and [@danielcompton](https://github.com/danielcompton) for their ongoing contributions. +And a big thanks to [@digitalcraftsman](https://github.com/digitalcraftsman) and [@onedrawingperday](https://github.com/onedrawingperday) for their relentless work on keeping the themes site in pristine condition and to [@kaushalmodi](https://github.com/kaushalmodi) for his great work on the documentation site. + +Many have also been busy writing and fixing the documentation in [hugoDocs](https://github.com/gohugoio/hugoDocs), +which has received **36 contributions by 21 contributors**. A special thanks to [@bep](https://github.com/bep), [@peaceiris](https://github.com/peaceiris), [@budparr](https://github.com/budparr), and [@tinymachine](https://github.com/tinymachine) for their work on the documentation site. + +As this release has required a significant effort with manual testing, a special thanks go to [@onedrawingperday](https://github.com/onedrawingperday) (the 300 theme demo sites have been invaluable to check for API-breakage!), [@adiabatic](https://github.com/adiabatic), and [@divinerites](https://github.com/divinerites). + +Hugo now has: + +* 34077+ [stars](https://github.com/gohugoio/hugo/stargazers) +* 439+ [contributors](https://github.com/gohugoio/hugo/graphs/contributors) +* 306+ [themes](http://themes.gohugo.io/) + + +## Notes +* `{{ %` as the outer-most shortcode delimiter means "pass the inner content to the content renderer" (e.g. Blackfriday); the old behavior can be had, see [#5763](https://github.com/gohugoio/hugo/issues/5763) +* `preserveTaxonomyNames`configuration option is removed. Use `.Page.Title`. +* We no longer limit the number of pages passed to the `RSS` Output Format. We have moved that limit to the internal `RSS` template, and you can do so yourself using the `Config.Services.RSS.Limit` in your custom template. +* We no longer add XML headers to Output Formats that output XML (``). This header is moved to the templates. If you have custom RSS or sitemap templates you may want to add the XML declaration to these. Since they, by default, is handled by Go's HTML template package, you must do something like this to make sure it's preserved: `{{ printf "" | safeHTML }}` +* More honest build times reported (`Total in 1234 ms`). We now do all initialization in the `Build` step, so you may get a higher time reported if you, as an example, have `--enableGitInfo` enabled, which now is included in the reported time. +* The taxonomy nodes now have a `.Page` accessor which makes it much simpler to get a proper `.Title` etc. see [#5719](https://github.com/gohugoio/hugo/issues/5719). +* The template keywords `with` and `if` now work properly for zero and interface types, see [#5739](https://github.com/gohugoio/hugo/issues/5739) +* Taxonomy terms lists (`Page` of `Kind` `taxonomyTerm`) without any date(s) set (e.g. from front matter) will now pick the latest dates from the child pages. This is in line with how other branch nodes work in Hugo. +* A new configuration option, `Permalinkable`, is added to Output Format and enabled that by default for `HTML` and `AMP` types. See [#5706](https://github.com/gohugoio/hugo/issues/5706) +* `--stepAnalysis` is removed. If you want to really understand the latency in your project in Hugo, try the new `--trace` flag and pass that file to the many tools that read [Go Trace files](https://golang.org/pkg/runtime/trace/). There are also some newly hidden flags in `--profile-cpu`, `--profile-men`, `--profile-mutex`, hidden because they are considered to be only of interest to developers. +* Chroma is updated with many fixes and new lexers, see [#5797](https://github.com/gohugoio/hugo/issues/5797) +* We now support `Page`-relative aliases, e.g. aliases that do not start with a `/`, see [#5757](https://github.com/gohugoio/hugo/issues/5757) +* We now support context-relative (language) URLs in front matter, meaning that in most cases `url: /en/mypage` can be replaced with the more portable `url: mypage`. See [#5704](https://github.com/gohugoio/hugo/issues/5704) + +## Enhancements + +### Templates + +* Allow the partial template func to return any type [a55640de](https://github.com/gohugoio/hugo/commit/a55640de8e3944d3b9f64b15155148a0e35cb31e) [@bep](https://github.com/bep) [#5783](https://github.com/gohugoio/hugo/issues/5783) + +### Output + +* Add missing JSON tag [b6a60f71](https://github.com/gohugoio/hugo/commit/b6a60f718e376066456da37e7bb997a7697edc31) [@bep](https://github.com/bep) + +### Core + +* Log warning on relative front matter url with lang [f34e6172](https://github.com/gohugoio/hugo/commit/f34e6172cf2a4d1d1aef22304ecbc7c8e2d142ff) [@bep](https://github.com/bep) [#5818](https://github.com/gohugoio/hugo/issues/5818) +* Consider summary in front matter for .Summary [3a62d547](https://github.com/gohugoio/hugo/commit/3a62d54745e2cbfda6772390830042908d725c71) [@mcdee](https://github.com/mcdee) [#5800](https://github.com/gohugoio/hugo/issues/5800) +* Buffer the render pages chan [95029551](https://github.com/gohugoio/hugo/commit/950295516da882dcc51d83f70835dde230a0b4d6) [@bep](https://github.com/bep) +* Re-work "fast render" logic in the new flow [d0d661df](https://github.com/gohugoio/hugo/commit/d0d661dffd19d5ed6efbd4dd2c572bad008bd859) [@bep](https://github.com/bep) [#5811](https://github.com/gohugoio/hugo/issues/5811)[#5784](https://github.com/gohugoio/hugo/issues/5784) +* Allow relative URLs in front matter [5185fb06](https://github.com/gohugoio/hugo/commit/5185fb065b0f8a4142c29ee3e3cd917e917280a4) [@bep](https://github.com/bep) [#5704](https://github.com/gohugoio/hugo/issues/5704) +* Allow page-relative aliases [92baa14f](https://github.com/gohugoio/hugo/commit/92baa14fd3f45c0917c5988235cd1a0f8692f171) [@bep](https://github.com/bep) [#5757](https://github.com/gohugoio/hugo/issues/5757) +* Add a simple test for jsonify of Site [8bfd3a54](https://github.com/gohugoio/hugo/commit/8bfd3a54a4142c397cab69bfa9699e5b5db9b40b) [@bep](https://github.com/bep) [#5780](https://github.com/gohugoio/hugo/issues/5780) +* Do not fall back to site title if not set in content file [9bc6187b](https://github.com/gohugoio/hugo/commit/9bc6187b8337c4a370bd3f21130a764d9ef6f7b3) [@bep](https://github.com/bep) [#5784](https://github.com/gohugoio/hugo/issues/5784) +* Add a test for home page with no title [bceda1b2](https://github.com/gohugoio/hugo/commit/bceda1b288f0ad6282916826b596cb1fe19983bb) [@bep](https://github.com/bep) [#5784](https://github.com/gohugoio/hugo/issues/5784) +* Add String() to fileInfo [a7ee9b0b](https://github.com/gohugoio/hugo/commit/a7ee9b0bb98f519e485655af578fb35d755e5c44) [@bep](https://github.com/bep) [#5784](https://github.com/gohugoio/hugo/issues/5784) +* Remove unused slice [3011f36c](https://github.com/gohugoio/hugo/commit/3011f36c27ecde309325e6c75ca377f4f87fa97a) [@bep](https://github.com/bep) +* Adjust site benchmark [34c49d78](https://github.com/gohugoio/hugo/commit/34c49d788c102a370006e476d6f6143a51b2a03d) [@bep](https://github.com/bep) +* Adjust test for Go 1.12 [b4148cd1](https://github.com/gohugoio/hugo/commit/b4148cd1d9ea889b81070d3e84a37bd5d23e5746) [@bep](https://github.com/bep) + +### Other + +* Misc paginator adjustments [612a06f0](https://github.com/gohugoio/hugo/commit/612a06f0671125be6b42ec2982a18080005994c8) [@bep](https://github.com/bep) [#5825](https://github.com/gohugoio/hugo/issues/5825) +* Update to Go 1.12.2 and Go 1.11.7 [3db4a1cf](https://github.com/gohugoio/hugo/commit/3db4a1cf7ab12343ce5705ac56aa7ca6ea1677b6) [@bep](https://github.com/bep) [#5819](https://github.com/gohugoio/hugo/issues/5819) +* Adjust rlimit logic [708d4cee](https://github.com/gohugoio/hugo/commit/708d4ceebd491c6a89f271311eb8d94d6b5d58bc) [@bep](https://github.com/bep) [#5821](https://github.com/gohugoio/hugo/issues/5821) +* Add information about summary front matter variable [ed65bda3](https://github.com/gohugoio/hugo/commit/ed65bda3b43f6149e41ddb049cbb295a82473bc9) [@mcdee](https://github.com/mcdee) +* Regenerate JSON wrapper [ebab291c](https://github.com/gohugoio/hugo/commit/ebab291c0e321d23b098684bacaf830a3979e310) [@bep](https://github.com/bep) +* Add missing GitInfo to Page [75467cd7](https://github.com/gohugoio/hugo/commit/75467cd7852852305549a6c71ac503bb4a57e716) [@bep](https://github.com/bep) +* Add support for sha384 [d1553b4b](https://github.com/gohugoio/hugo/commit/d1553b4b0f83e4a4305d2b4ab9ba6e305637f134) [@bep](https://github.com/bep) [#5815](https://github.com/gohugoio/hugo/issues/5815) +* Add HUGO_NUMWORKERMULTIPLIER [87b16abd](https://github.com/gohugoio/hugo/commit/87b16abd93ff60acd245776d5b0d914fd580c259) [@bep](https://github.com/bep) [#5814](https://github.com/gohugoio/hugo/issues/5814) +* Use YAML for the benchmark compare [8559f5c2](https://github.com/gohugoio/hugo/commit/8559f5c29f20b7b5188f93f8b1d9e510e3dee4f5) [@bep](https://github.com/bep) +* Update to imaging v1.6.0 [032e6802](https://github.com/gohugoio/hugo/commit/032e6802d1f34cc41f6d1275fdd2deab8bbe5480) [@bep](https://github.com/bep) [#5812](https://github.com/gohugoio/hugo/issues/5812) +* Adjust the howSimilar logic vs strings [4494a01b](https://github.com/gohugoio/hugo/commit/4494a01b794ab785c64c8e93c61ccbfa845bc478) [@bep](https://github.com/bep) +* Implement compare.ProbablyEqer for the core slices [e91e222c](https://github.com/gohugoio/hugo/commit/e91e222cd21213961d1e6206e1523bee2c21fa0c) [@bep](https://github.com/bep) [#5808](https://github.com/gohugoio/hugo/issues/5808) +* Regenerate docshelper data [bfdc4496](https://github.com/gohugoio/hugo/commit/bfdc44964af82807fa91407132d47b6bf52704c3) [@bep](https://github.com/bep) [#5799](https://github.com/gohugoio/hugo/issues/5799) +* Update Chroma [cc8515f1](https://github.com/gohugoio/hugo/commit/cc8515f18767298da4c6d712d1fd747c7950150b) [@bep](https://github.com/bep) [#5780](https://github.com/gohugoio/hugo/issues/5780) +* Regenerate CLI docs [bb533ca5](https://github.com/gohugoio/hugo/commit/bb533ca5e1c778c95ed7014eab99c8cc1bd4c85e) [@bep](https://github.com/bep) [#5779](https://github.com/gohugoio/hugo/issues/5779) +* Update Afero [10bb614a](https://github.com/gohugoio/hugo/commit/10bb614a70db22c01c9a52054ede35bc0a01aa24) [@bep](https://github.com/bep) [#5673](https://github.com/gohugoio/hugo/issues/5673) +* Avoid nilpointer on no File on Page [4dae52af](https://github.com/gohugoio/hugo/commit/4dae52af680e6ff2c8cdeb4ce1f219330b27001c) [@bep](https://github.com/bep) [#5781](https://github.com/gohugoio/hugo/issues/5781) +* Improve the "feature not available" error [794d4052](https://github.com/gohugoio/hugo/commit/794d4052b87c98943588b35e1cfecc06e6a0c7f2) [@bep](https://github.com/bep) +* Re-introduce .Page.Page [91ef9655](https://github.com/gohugoio/hugo/commit/91ef9655aaf2adea3a044bf9a464908084917a98) [@bep](https://github.com/bep) [#5784](https://github.com/gohugoio/hugo/issues/5784) +* Apply staticcheck recommendations [b5f39d23](https://github.com/gohugoio/hugo/commit/b5f39d23b86f9cb83c51da9fe4abb4c19c01c3b7) [@bep](https://github.com/bep) +* Run gofmt -s [d30e8454](https://github.com/gohugoio/hugo/commit/d30e845485b416e1c48fade14694b12a9fe59b6b) [@bep](https://github.com/bep) +* Make Page an interface [597e418c](https://github.com/gohugoio/hugo/commit/597e418cb02883418f2cebb41400e8e61413f651) [@bep](https://github.com/bep) [#5074](https://github.com/gohugoio/hugo/issues/5074)[#5763](https://github.com/gohugoio/hugo/issues/5763)[#5758](https://github.com/gohugoio/hugo/issues/5758)[#5090](https://github.com/gohugoio/hugo/issues/5090)[#5204](https://github.com/gohugoio/hugo/issues/5204)[#4695](https://github.com/gohugoio/hugo/issues/4695)[#5607](https://github.com/gohugoio/hugo/issues/5607)[#5707](https://github.com/gohugoio/hugo/issues/5707)[#5719](https://github.com/gohugoio/hugo/issues/5719)[#3113](https://github.com/gohugoio/hugo/issues/3113)[#5706](https://github.com/gohugoio/hugo/issues/5706)[#5767](https://github.com/gohugoio/hugo/issues/5767)[#5723](https://github.com/gohugoio/hugo/issues/5723)[#5769](https://github.com/gohugoio/hugo/issues/5769)[#5770](https://github.com/gohugoio/hugo/issues/5770)[#5771](https://github.com/gohugoio/hugo/issues/5771)[#5759](https://github.com/gohugoio/hugo/issues/5759)[#5776](https://github.com/gohugoio/hugo/issues/5776)[#5777](https://github.com/gohugoio/hugo/issues/5777)[#5778](https://github.com/gohugoio/hugo/issues/5778) +* List future and expired dates in CSV format [44f5c1c1](https://github.com/gohugoio/hugo/commit/44f5c1c14cb1f42cc5f01739c289e9cfc83602af) [@danielcompton](https://github.com/danielcompton) [#5610](https://github.com/gohugoio/hugo/issues/5610) +* Update to Go 1.12.1 and Go 1.11.6 [984a73af](https://github.com/gohugoio/hugo/commit/984a73af9e5b5145297723f26faa38f29ca2918d) [@bep](https://github.com/bep) [#5755](https://github.com/gohugoio/hugo/issues/5755) +* Update Viper [79d517d8](https://github.com/gohugoio/hugo/commit/79d517d86c02e879bc4a43ab86b817c589b61485) [@bep](https://github.com/bep) +* Update to Go 1.12 [b9e75afd](https://github.com/gohugoio/hugo/commit/b9e75afd6c007a6af8b71caeebc4a5a24c270861) [@bep](https://github.com/bep) [#5716](https://github.com/gohugoio/hugo/issues/5716) +* Remove Gitter dev chat link [dfc72d61](https://github.com/gohugoio/hugo/commit/dfc72d61a522f5cb926271d9391a8670f064d198) [@bep](https://github.com/bep) +* Update Travis config to work for forked builds [bdf47e8d](https://github.com/gohugoio/hugo/commit/bdf47e8da80f87b7689badf48a6b8672c048d7e4) [@grahamjamesaddis](https://github.com/grahamjamesaddis) +* Add skipHTML option to blackfriday config [75904332](https://github.com/gohugoio/hugo/commit/75904332f3bedcfe656856821d4c9560a177cc51) [@arrtchiu](https://github.com/arrtchiu) +* Update stretchr/testify to 1.3.0. [60c0eb4e](https://github.com/gohugoio/hugo/commit/60c0eb4e892baedd533424b47baf7039c0005f87) [@QuLogic](https://github.com/QuLogic) +* Rewrite relative action URLS [c154c2f7](https://github.com/gohugoio/hugo/commit/c154c2f7b2a6703dbde7f6bd2a1817a39c6fd2ea) [@larson004](https://github.com/larson004) [#5701](https://github.com/gohugoio/hugo/issues/5701) +* Support Docker args TAGS, WORKDIR, CGO; speed up repetitive builds [075b17ee](https://github.com/gohugoio/hugo/commit/075b17ee1d621e0ebbcecf1063f8f68a00ac221a) [@tonymet](https://github.com/tonymet) +* Support nested keys/fields with missing values with the `where` function [908692fa](https://github.com/gohugoio/hugo/commit/908692fae5c5840a0db8c7dd389b59dd3b8026b9) [@tryzniak](https://github.com/tryzniak) [#5637](https://github.com/gohugoio/hugo/issues/5637)[#5416](https://github.com/gohugoio/hugo/issues/5416) +* Update debouncer version [7e4b18c5](https://github.com/gohugoio/hugo/commit/7e4b18c5ae409435760ebd86ff9ee3061db34a5d) [@bep](https://github.com/bep) + +## Fixes + +### Templates + +* Fix mutex unlock [e54213f5](https://github.com/gohugoio/hugo/commit/e54213f5257267ed232b2465337c39ddc8c73388) [@bep](https://github.com/bep) +* Fix template truth logic [02eaddc2](https://github.com/gohugoio/hugo/commit/02eaddc2fbe92c26e67d9f82dd9aabecbbf2106c) [@bep](https://github.com/bep) [#5738](https://github.com/gohugoio/hugo/issues/5738) +* Fix strings.HasPrefix args order [72010429](https://github.com/gohugoio/hugo/commit/7201042946dde78d5ea4fea9cb006fb4dded55c1) [@quasilyte](https://github.com/quasilyte) + +### Core + +* Fix default date assignment for sections [1d9dde82](https://github.com/gohugoio/hugo/commit/1d9dde82a0577d93eea8ed0a7ec0b4ae3068eb19) [@bep](https://github.com/bep) [#5784](https://github.com/gohugoio/hugo/issues/5784) +* Fix the GOMAXPROCS env get [415ca967](https://github.com/gohugoio/hugo/commit/415ca9673d3bd3c06ab94f3d83897c892fce5f27) [@bep](https://github.com/bep) [#5813](https://github.com/gohugoio/hugo/issues/5813) +* Fix benchmark for YAML front matter [e2dc432f](https://github.com/gohugoio/hugo/commit/e2dc432fe287a280aeba94bafdcce85b7a8646c6) [@bep](https://github.com/bep) +* Fix alias path for AMP and similar [f9d6feca](https://github.com/gohugoio/hugo/commit/f9d6feca0802cd83c4d843244ce389cf7c792cec) [@bep](https://github.com/bep) [#5760](https://github.com/gohugoio/hugo/issues/5760) + +### Other + +* Fix image publish ordering issue [439ab033](https://github.com/gohugoio/hugo/commit/439ab0339d9ac6972caabaa55fa41887ace839cb) [@bep](https://github.com/bep) [#5730](https://github.com/gohugoio/hugo/issues/5730) +* Fix doLiveReload logic [4a2a8aff](https://github.com/gohugoio/hugo/commit/4a2a8afff2021c8e967254c76c159147da7e78fa) [@bep](https://github.com/bep) [#5754](https://github.com/gohugoio/hugo/issues/5754) +* Fix args order in strings.TrimPrefix [483cf19d](https://github.com/gohugoio/hugo/commit/483cf19d5de05e8a83fd1be6934baa169c7fd7c8) [@quasilyte](https://github.com/quasilyte) + + + + + diff -Nru hugo-0.54.0/docs/content/en/news/0.55.1-relnotes/index.md hugo-0.55.1/docs/content/en/news/0.55.1-relnotes/index.md --- hugo-0.54.0/docs/content/en/news/0.55.1-relnotes/index.md 1970-01-01 00:00:00.000000000 +0000 +++ hugo-0.55.1/docs/content/en/news/0.55.1-relnotes/index.md 2019-04-12 09:56:13.000000000 +0000 @@ -0,0 +1,53 @@ + +--- +date: 2019-04-12 +title: "0.55.1" +description: "0.55.1" +categories: ["Releases"] +images: +- images/blog/hugo-bug-poster.png + +--- + + + +This is a bug-fix release with a couple of important fixes. + + +Hugo now has: + +* 34225+ [stars](https://github.com/gohugoio/hugo/stargazers) +* 439+ [contributors](https://github.com/gohugoio/hugo/graphs/contributors) +* 307+ [themes](http://themes.gohugo.io/) + + +## Notes + +* Replace deprecated .GetParam usage [27a8049d](https://github.com/gohugoio/hugo/commit/27a8049da7996b703d02083182b84a002eae2599) [@bep](https://github.com/bep) [#5834](https://github.com/gohugoio/hugo/issues/5834) + +## Enhancements + +### Core + +* Add a test for parent's resources in shortcode [8d7607ae](https://github.com/gohugoio/hugo/commit/8d7607aed10b3fe7373126ff5fa7dae36c559d7f) [@bep](https://github.com/bep) [#5833](https://github.com/gohugoio/hugo/issues/5833) + +### Other + +* Remove the space in `. RelPermalink` [7966c0b5](https://github.com/gohugoio/hugo/commit/7966c0b5b7b2297527f8be9040b793de5e4e3f48) [@yihui](https://github.com/yihui) + +## Fixes + +### Core + +* Fix simple menu config [9e9a1f92](https://github.com/gohugoio/hugo/commit/9e9a1f92baf151f8d840d6b5b963945d1410ce25) [@bep](https://github.com/bep) + +### Other + +* Fix [4d425a86](https://github.com/gohugoio/hugo/commit/4d425a86f5c03a5cca27d4e0f99d61acbb938d80) [@bep](https://github.com/bep) +* Fix paginator refresh on server change [f7375c49](https://github.com/gohugoio/hugo/commit/f7375c497239115cd30ae42af6b4d298e4e7ad7d) [@bep](https://github.com/bep) [#5838](https://github.com/gohugoio/hugo/issues/5838) +* Fix .RSSLinke deprecation message [3b86b4a9](https://github.com/gohugoio/hugo/commit/3b86b4a9f5ce010c9714d813d5b8ecddda22c69f) [@bep](https://github.com/bep) [#4427](https://github.com/gohugoio/hugo/issues/4427) + + + + + diff -Nru hugo-0.54.0/docs/content/en/readfiles/bfconfig.md hugo-0.55.1/docs/content/en/readfiles/bfconfig.md --- hugo-0.54.0/docs/content/en/readfiles/bfconfig.md 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/docs/content/en/readfiles/bfconfig.md 2019-04-12 09:56:13.000000000 +0000 @@ -71,6 +71,11 @@ Example: Include `autoHeaderIds` as `false` in the list to disable Blackfriday's `EXTENSION_AUTO_HEADER_IDS`.
*See [Blackfriday extensions](#blackfriday-extensions) section for information on all extensions.* +`skipHTML` +: default: **`false`**
+ Blackfriday flag: **`HTML_SKIP_HTML`**
+ Purpose: `true` causes any HTML in the markdown files to be skipped. + ## Blackfriday extensions `noIntraEmphasis` diff -Nru hugo-0.54.0/docs/content/en/showcase/fireship/bio.md hugo-0.55.1/docs/content/en/showcase/fireship/bio.md --- hugo-0.54.0/docs/content/en/showcase/fireship/bio.md 1970-01-01 00:00:00.000000000 +0000 +++ hugo-0.55.1/docs/content/en/showcase/fireship/bio.md 2019-04-12 09:56:13.000000000 +0000 @@ -0,0 +1,6 @@ + +**Fireship.io** is an ecosystem of detailed and practical resources for developers who want to build and ship high-quality apps. + +The site is built by: + +* [Jeff Delaney](https://fireship.io/contributors/jeff-delaney/) Binary files /tmp/tmp98pLlf/8kpyHFjUd6/hugo-0.54.0/docs/content/en/showcase/fireship/featured.png and /tmp/tmp98pLlf/owPkQYg8h2/hugo-0.55.1/docs/content/en/showcase/fireship/featured.png differ diff -Nru hugo-0.54.0/docs/content/en/showcase/fireship/index.md hugo-0.55.1/docs/content/en/showcase/fireship/index.md --- hugo-0.54.0/docs/content/en/showcase/fireship/index.md 1970-01-01 00:00:00.000000000 +0000 +++ hugo-0.55.1/docs/content/en/showcase/fireship/index.md 2019-04-12 09:56:13.000000000 +0000 @@ -0,0 +1,18 @@ +--- + +title: fireship.io +date: 2019-02-02 +description: "Showcase: \"Hugo helps us create complex technical content that integrates engaging web components\"" +siteURL: https://fireship.io +siteSource: https://github.com/fireship-io/fireship.io +byline: "[Jeff Delaney](https://github.com/codediodeio), Fireship.io Creator" +--- + +After careful consideration of JavaScript/JSX-based static site generators, it became clear that Hugo was the only tool capable of handling our project's complex demands. Not only do we have multiple content formats and taxonomies, but we often need to customize the experience at a more granular level. The problems Hugo has solved for us include: + +- **Render speed.** We know from past experience that JavaScript-based static site generators become very slow when you have thousands of pages and images. +- **Feature-rich.** Our site has a long list of specialized needs and Hugo somehow manages to cover every single use case. +- **Composability.** Hugo's partial and shortcode systems empower us to write DRY and maintainable templates. +- **Simplicity.** Hugo is easy to learn (even without Go experience) and doesn't burden us with brittle dependencies. + +The site is able to achieve Lighthouse performance scores of 95+, despite the fact that it is a fully interactive PWA that ships Angular and Firebase in the JS bundle. This is made possible by (1) prerendering content with Hugo and (2) lazily embedding native web components directly in the HTML and markdown. We provide a [detailed explanation](https://youtu.be/gun8OiGtlNc) of the architecture on YouTube and can't imagine development without Hugo. diff -Nru hugo-0.54.0/docs/content/en/templates/files.md hugo-0.55.1/docs/content/en/templates/files.md --- hugo-0.54.0/docs/content/en/templates/files.md 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/docs/content/en/templates/files.md 2019-04-12 09:56:13.000000000 +0000 @@ -1,7 +1,7 @@ --- title: Local File Templates linktitle: Local File Templates -description: Hugo's `readerDir` and `readFile` functions make it easy to traverse your project's directory structure and write file contents to your templates. +description: Hugo's `readDir` and `readFile` functions make it easy to traverse your project's directory structure and write file contents to your templates. godocref: https://golang.org/pkg/os/#FileInfo date: 2017-02-01 publishdate: 2017-02-01 diff -Nru hugo-0.54.0/docs/content/en/templates/lists.md hugo-0.55.1/docs/content/en/templates/lists.md --- hugo-0.54.0/docs/content/en/templates/lists.md 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/docs/content/en/templates/lists.md 2019-04-12 09:56:13.000000000 +0000 @@ -162,7 +162,7 @@ ### Section Template -This list template has been modified slightly from a template originally used in [spf13.com](http://spf13.com/). It makes use of [partial templates][partials] for the chrome of the rendered page rather than using a [base template][base] The examples that follow also use the [content view templates][views] `li.html` or `summary.html`. +This list template has been modified slightly from a template originally used in [spf13.com](http://spf13.com/). It makes use of [partial templates][partials] for the chrome of the rendered page rather than using a [base template][base]. The examples that follow also use the [content view templates][views] `li.html` or `summary.html`. {{< code file="layouts/section/posts.html" >}} {{ partial "header.html" . }} diff -Nru hugo-0.54.0/docs/content/en/themes/theme-components.md hugo-0.55.1/docs/content/en/themes/theme-components.md --- hugo-0.54.0/docs/content/en/themes/theme-components.md 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/docs/content/en/themes/theme-components.md 2019-04-12 09:56:13.000000000 +0000 @@ -45,7 +45,7 @@ The same rules apply here: The left-most param/menu etc. with the same ID will win. There are some hidden and experimental namespace support in the above, which we will work to improve in the future, but theme authors are encouraged to create their own namespaces to avoid naming conflicts. -[^1]: Including theme components in the themes is currently not supported for themes hosted on [The Hugo Themes Site](https://themes.gohugo.io/), but can be really useful if you want to create your own theme based on a theme you find on that site. +[^1]: For themes hosted on the [Hugo Themes Showcase](https://themes.gohugo.io/) components need to be added as git submodules that point to the directory `exampleSite/themes` diff -Nru hugo-0.54.0/docs/content/en/tools/frontends.md hugo-0.55.1/docs/content/en/tools/frontends.md --- hugo-0.54.0/docs/content/en/tools/frontends.md 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/docs/content/en/tools/frontends.md 2019-04-12 09:56:13.000000000 +0000 @@ -19,10 +19,9 @@ --- * [enwrite](https://github.com/zzamboni/enwrite). Enwrite enables evernote-powered, statically generated blogs and websites. Now posting to your blog or updating your website is as easy as writing a new note in Evernote! -* [caddy-hugo](https://github.com/hacdias/caddy-hugo). `caddy-hugo` is an add-on for [Caddy](https://caddyserver.com/) that delivers a good UI to edit the content of your Hugo website. * [Lipi](https://github.com/SohanChy/Lipi). Lipi is a native GUI frontend written in Java to manage your Hugo websites. * [Netlify CMS](https://netlifycms.org). Netlify CMS is an open source, serverless solution for managing Git based content in static sites, and it works on any platform that can host static sites. A [Hugo/Netlify CMS starter](https://github.com/netlify-templates/one-click-hugo-cms) is available to get new projects running quickly. -* [Hokus CMS](https://www.hokus.io). Hokus CMS is an open source, multiplatform, easy to use, desktop application for Hugo. Build from simple to complex user interfaces for Hugo websites by choosing from a dozen ready-to-use components — all for free, with no vendor lock-in. +* [Hokus CMS](https://github.com/julianoappelklein/hokus). Hokus CMS is an open source, multiplatform, easy to use, desktop application for Hugo. Build from simple to complex user interfaces for Hugo websites by choosing from a dozen ready-to-use components — all for free, with no vendor lock-in. ## Commercial Services diff -Nru hugo-0.54.0/docs/content/en/tools/starter-kits.md hugo-0.55.1/docs/content/en/tools/starter-kits.md --- hugo-0.54.0/docs/content/en/tools/starter-kits.md 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/docs/content/en/tools/starter-kits.md 2019-04-12 09:56:13.000000000 +0000 @@ -24,11 +24,11 @@ {{% /note %}} * [Hugo Wrapper][hugow]. Hugo Wrapper is a POSIX-style shell script which acts as a wrapper to download and run Hugo binary for your platform. It can be executed in variety of [Operating Systems][hugow-test] and [Command Shells][hugow-test]. -* [Victor Hugo][]. Victor Hugo is a Hugo boilerplate for creating truly epic websites using Gulp + Webpack as an asset pipeline. Victor Hugo uses post-css and Babel for CSS and JavaScript, respectively, and is actively maintained. +* [Victor Hugo][]. Victor Hugo is a Hugo boilerplate for creating truly epic websites using Webpack as an asset pipeline. Victor Hugo uses post-css and Babel for CSS and JavaScript, respectively, and is actively maintained. * [GOHUGO AMP][]. GoHugo AMP is a starter theme that aims to make it easy to adopt [Google's AMP Project][amp]. The starter kit comes with 40+ shortcodes and partials plus automatic structured data. The project also includes a [separate site with extensive documentation][gohugodocs]. * [Blaupause][]. Blaupause is a developer-friendly Hugo starter kit based on Gulp tasks. It comes ES6-ready with several helpers for SVG and fonts and basic structure for HTML, SCSS, and JavaScript. * [hugulp][]. hugulp is a tool to optimize the assets of a Hugo website. The main idea is to recreate the famous Ruby on Rails Asset Pipeline, which minifies, concatenates and fingerprints the assets used in your website. -* [Atlas][]. Atlas is a Hugo boilerplate designed to speed up development with support for Netlify, Netlify CMS, Gulp, Linting, SCSS, ES6 & more. It's actively maintained and contributions are always welcome. +* [Atlas][]. Atlas is a Hugo boilerplate designed to speed up development with support for Netlify, Hugo Pipes, SCSS & more. It's actively maintained and contributions are always welcome. [addkit]: https://github.com/gohugoio/hugo/edit/master/docs/content/en/tools/starter-kits.md diff -Nru hugo-0.54.0/docs/content/en/troubleshooting/faq.md hugo-0.55.1/docs/content/en/troubleshooting/faq.md --- hugo-0.54.0/docs/content/en/troubleshooting/faq.md 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/docs/content/en/troubleshooting/faq.md 2019-04-12 09:56:13.000000000 +0000 @@ -42,3 +42,15 @@ ## Can I use the latest Hugo version on Netlify? Yes you can! Read [this](/hosting-and-deployment/hosting-on-netlify/#configure-hugo-version-in-netlify). + +## I get "TOCSS ... this feature is not available in your current Hugo version" + +If you process `SCSS` or `SASS` to `CSS` in your Hugo project, you need the Hugo `extended` version, or else you may see this error message: + +```bash +error: failed to transform resource: TOCSS: failed to transform "scss/main.scss" (text/x-scss): this feature is not available in your current Hugo version +``` + +We release two set of binaries for technical reasons. The extended is what you get by default, as an example, when you run `brew install hugo` on `macOS`. On the [release page](https://github.com/gohugoio/hugo/releases), look for archives with `extended` in the name. + +To confirm, run `hugo version` and look for the word `extended`. diff -Nru hugo-0.54.0/docs/content/en/variables/files.md hugo-0.55.1/docs/content/en/variables/files.md --- hugo-0.54.0/docs/content/en/variables/files.md 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/docs/content/en/variables/files.md 2019-04-12 09:56:13.000000000 +0000 @@ -25,7 +25,7 @@ The `.File` object contains the following fields: .File.Path -: the original relative path of the page (e.g., `content/posts/foo.en.md`) +: the original relative path of the page, relative to the content dir (e.g., `posts/foo.en.md`) .File.LogicalName : the name of the content file that represents a page (e.g., `foo.en.md`) diff -Nru hugo-0.54.0/docs/content/en/variables/page.md hugo-0.55.1/docs/content/en/variables/page.md --- hugo-0.54.0/docs/content/en/variables/page.md 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/docs/content/en/variables/page.md 2019-04-12 09:56:13.000000000 +0000 @@ -79,8 +79,7 @@ : the page's *kind*. Possible return values are `page`, `home`, `section`, `taxonomy`, or `taxonomyTerm`. Note that there are also `RSS`, `sitemap`, `robotsTXT`, and `404` kinds, but these are only available during the rendering of each of these respective page's kind and therefore *not* available in any of the `Pages` collections. .Language -: a language object that points to the language's definition in the site -`config`. +: a language object that points to the language's definition in the site `config`. `.Language.Lang` gives you the language code. .Lastmod : the date the content was last modified. `.Lastmod` pulls from the `lastmod` field in a content's front matter. @@ -93,10 +92,7 @@ .LinkTitle : access when creating links to the content. If set, Hugo will use the `linktitle` from the front matter before `title`. -.Next (deprecated) -: In older Hugo versions this pointer went the wrong direction. Please use `.PrevPage` instead. - -.NextPage +.Next : Pointer to the next [regular page](/variables/site/#site-pages) (sorted by Hugo's [default sort](/templates/lists#default-weight-date-linktitle-filepath)). Example: `{{if .NextPage}}{{.NextPage.Permalink}}{{end}}`. .NextInSection @@ -119,9 +115,6 @@ : the Page content stripped of HTML as a `[]string` using Go's [`strings.Fields`](https://golang.org/pkg/strings/#Fields) to split `.Plain` into a slice. .Prev (deprecated) -: In older Hugo versions this pointer went the wrong direction. Please use `.NextPage` instead. - -.PrevPage : Pointer to the previous [regular page](/variables/site/#site-pages) (sorted by Hugo's [default sort](/templates/lists#default-weight-date-linktitle-filepath)). Example: `{{if .PrevPage}}{{.PrevPage.Permalink}}{{end}}`. .PrevInSection @@ -130,8 +123,8 @@ .PublishDate : the date on which the content was or will be published; `.Publishdate` pulls from the `publishdate` field in a content's front matter. See also `.ExpiryDate`, `.Date`, and `.Lastmod`. -.RSSLink -: link to the taxonomies' RSS link. +.RSSLink (deprecated) +: link to the page's RSS feed. This is deprecated. You should instead do something like this: `{{ with .OutputFormats.Get "RSS" }}{{ .RelPermalink }}{{ end }}`. .RawContent : raw markdown content without the front matter. Useful with [remarkjs.com]( @@ -160,7 +153,7 @@ : returns the site for the first language. If this is not a multilingual setup, it will return itself. .Summary -: a generated summary of the content for easily showing a snippet in a summary view. The breakpoint can be set manually by inserting <!--more--> at the appropriate place in the content page. See [Content Summaries](/content-management/summaries/) for more details. +: a generated summary of the content for easily showing a snippet in a summary view. The breakpoint can be set manually by inserting <!--more--> at the appropriate place in the content page, or the summary can be written independent of the page text. See [Content Summaries](/content-management/summaries/) for more details. .TableOfContents : the rendered [table of contents](/content-management/toc/) for the page. diff -Nru hugo-0.54.0/docs/data/docs.json hugo-0.55.1/docs/data/docs.json --- hugo-0.54.0/docs/data/docs.json 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/docs/data/docs.json 2019-04-12 09:56:13.000000000 +0000 @@ -67,6 +67,13 @@ ] }, { + "Name": "Arduino", + "Aliases": [ + "arduino", + "ino" + ] + }, + { "Name": "Awk", "Aliases": [ "awk", @@ -479,6 +486,14 @@ ] }, { + "Name": "GraphQL", + "Aliases": [ + "gql", + "graphql", + "graphqls" + ] + }, + { "Name": "Groovy", "Aliases": [ "gradle", @@ -654,6 +669,13 @@ ] }, { + "Name": "Matlab", + "Aliases": [ + "m", + "matlab" + ] + }, + { "Name": "MiniZinc", "Aliases": [ "MZN", @@ -1140,6 +1162,13 @@ ] }, { + "Name": "Turing", + "Aliases": [ + "tu", + "turing" + ] + }, + { "Name": "Turtle", "Aliases": [ "ttl", @@ -1181,6 +1210,15 @@ ] }, { + "Name": "VB.net", + "Aliases": [ + "bas", + "vb", + "vb.net", + "vbnet" + ] + }, + { "Name": "VHDL", "Aliases": [ "vhd", @@ -1356,6 +1394,27 @@ ] }, { + "type": "image/jpg", + "string": "image/jpg", + "mainType": "image", + "subType": "jpg", + "delimiter": ".", + "suffixes": [ + "jpg", + "jpeg" + ] + }, + { + "type": "image/png", + "string": "image/png", + "mainType": "image", + "subType": "png", + "delimiter": ".", + "suffixes": [ + "png" + ] + }, + { "type": "image/svg+xml", "string": "image/svg+xml", "mainType": "image", @@ -1459,7 +1518,8 @@ "isPlainText": false, "isHTML": true, "noUgly": false, - "notAlternative": false + "notAlternative": false, + "permalinkable": true }, { "MediaType": "text/css", @@ -1481,7 +1541,8 @@ "isPlainText": true, "isHTML": false, "noUgly": false, - "notAlternative": true + "notAlternative": true, + "permalinkable": false }, { "MediaType": "text/csv", @@ -1503,7 +1564,8 @@ "isPlainText": true, "isHTML": false, "noUgly": false, - "notAlternative": false + "notAlternative": false, + "permalinkable": false }, { "MediaType": "text/calendar", @@ -1525,7 +1587,8 @@ "isPlainText": true, "isHTML": false, "noUgly": false, - "notAlternative": false + "notAlternative": false, + "permalinkable": false }, { "MediaType": "text/html", @@ -1547,7 +1610,8 @@ "isPlainText": false, "isHTML": true, "noUgly": false, - "notAlternative": false + "notAlternative": false, + "permalinkable": true }, { "MediaType": "application/json", @@ -1569,7 +1633,8 @@ "isPlainText": true, "isHTML": false, "noUgly": false, - "notAlternative": false + "notAlternative": false, + "permalinkable": false }, { "MediaType": "text/plain", @@ -1591,7 +1656,8 @@ "isPlainText": true, "isHTML": false, "noUgly": false, - "notAlternative": false + "notAlternative": false, + "permalinkable": false }, { "MediaType": "application/rss+xml", @@ -1613,7 +1679,8 @@ "isPlainText": false, "isHTML": false, "noUgly": true, - "notAlternative": false + "notAlternative": false, + "permalinkable": false }, { "MediaType": "application/xml", @@ -1635,7 +1702,8 @@ "isPlainText": false, "isHTML": false, "noUgly": true, - "notAlternative": false + "notAlternative": false, + "permalinkable": false } ], "layouts": [ @@ -2144,6 +2212,17 @@ } }, "compare": { + "And": { + "Description": "And computes the Boolean AND of its arguments, returning\nthe first false argument it encounters, or the last argument.", + "Args": [ + "arg0", + "args" + ], + "Aliases": [ + "and" + ], + "Examples": [] + }, "Conditional": { "Description": "Conditional can be used as a ternary operator.\nIt returns a if condition, else b.", "Args": [ @@ -2256,6 +2335,27 @@ "ne" ], "Examples": [] + }, + "Not": { + "Description": "Not returns the Boolean negation of its argument.", + "Args": [ + "arg" + ], + "Aliases": [ + "not" + ], + "Examples": [] + }, + "Or": { + "Description": "Or computes the Boolean OR of its arguments, returning\nthe first true argument it encounters, or the last argument.", + "Args": [ + "arg0", + "args" + ], + "Aliases": [ + "or" + ], + "Examples": [] } }, "collections": { @@ -3226,6 +3326,34 @@ ] } }, + "reflect": { + "IsMap": { + "Description": "IsMap reports whether v is a map.", + "Args": [ + "v" + ], + "Aliases": null, + "Examples": [ + [ + "{{ if reflect.IsMap (dict \"a\" 1) }}Map{{ end }}", + "Map" + ] + ] + }, + "IsSlice": { + "Description": "IsSlice reports whether v is a slice.", + "Args": [ + "v" + ], + "Aliases": null, + "Examples": [ + [ + "{{ if reflect.IsSlice (slice 1 2 3) }}Slice{{ end }}", + "Slice" + ] + ] + } + }, "resources": { "Concat": { "Description": "", @@ -3392,6 +3520,18 @@ } }, "site": { + "BaseURL": { + "Description": "", + "Args": null, + "Aliases": null, + "Examples": null + }, + "Data": { + "Description": "", + "Args": null, + "Aliases": null, + "Examples": null + }, "Hugo": { "Description": "", "Args": null, @@ -3408,6 +3548,60 @@ "Description": "", "Args": null, "Aliases": null, + "Examples": null + }, + "LastChange": { + "Description": "", + "Args": null, + "Aliases": null, + "Examples": null + }, + "Menus": { + "Description": "", + "Args": null, + "Aliases": null, + "Examples": null + }, + "Pages": { + "Description": "", + "Args": null, + "Aliases": null, + "Examples": null + }, + "Params": { + "Description": "", + "Args": null, + "Aliases": null, + "Examples": null + }, + "RegularPages": { + "Description": "", + "Args": null, + "Aliases": null, + "Examples": null + }, + "ServerPort": { + "Description": "", + "Args": null, + "Aliases": null, + "Examples": null + }, + "Sites": { + "Description": "", + "Args": null, + "Aliases": null, + "Examples": null + }, + "Taxonomies": { + "Description": "", + "Args": null, + "Aliases": null, + "Examples": null + }, + "Title": { + "Description": "", + "Args": null, + "Aliases": null, "Examples": null } }, diff -Nru hugo-0.54.0/docs/.gitignore hugo-0.55.1/docs/.gitignore --- hugo-0.54.0/docs/.gitignore 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/docs/.gitignore 2019-04-12 09:56:13.000000000 +0000 @@ -2,3 +2,4 @@ /public nohup.out .DS_Store +trace.out \ No newline at end of file diff -Nru hugo-0.54.0/docs/layouts/shortcodes/note.html hugo-0.55.1/docs/layouts/shortcodes/note.html --- hugo-0.54.0/docs/layouts/shortcodes/note.html 2019-02-01 09:40:32.000000000 +0000 +++ hugo-0.55.1/docs/layouts/shortcodes/note.html 2019-04-12 09:56:13.000000000 +0000 @@ -1,3 +1,4 @@ +{{ $_hugo_config := `{ "version": 1 }` }}