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

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-03-18all: gofmt -w -r 'interface{} -> any' .Bjørn Erik Pedersen
Updates #9687
2021-12-02Implement XML data supportPaul van Brouwershaven
Example: ``` {{ with resources.Get "https://example.com/rss.xml" | transform.Unmarshal }} {{ range .channel.item }} <strong>{{ .title | plainify | htmlUnescape }}</strong><br /> <p>{{ .description | plainify | htmlUnescape }}</p> {{ $link := .link | plainify | htmlUnescape }} <a href="{{ $link }}">{{ $link }}</a><br /> <hr> {{ end }} {{ end }} ``` Closes #4470
2021-08-04parser: Indent TOML tablesBjørn Erik Pedersen
Fixes #8850
2021-07-28Switch to go-toml v2Bjørn Erik Pedersen
We have been using `go-toml` for language files only. This commit makes it the only TOML library. It's spec compliant and very fast. A benchark building a site with 200 pages with TOML front matter: ```bash name old time/op new time/op delta SiteNew/Regular_TOML_front_matter-16 48.5ms ± 1% 47.1ms ± 1% -2.85% (p=0.029 n=4+4) name old alloc/op new alloc/op delta SiteNew/Regular_TOML_front_matter-16 16.9MB ± 0% 16.7MB ± 0% -1.56% (p=0.029 n=4+4) name old allocs/op new allocs/op delta SiteNew/Regular_TOML_front_matter-16 302k ± 0% 296k ± 0% -2.20% (p=0.029 n=4+4) ``` Note that the front matter unmarshaling is only a small part of building a site, so the above is very good. Fixes #8801
2019-03-24all: Apply staticcheck recommendationsBjørn Erik Pedersen
2018-10-22Convert the rest to new page parser code pathsBjørn Erik Pedersen
And remove some now unused code. See #5324
2018-10-22parser/metadecoders: Consolidate the metadata decodersBjørn Erik Pedersen
See #5324
2018-10-22hugolib: Integrate new page parserBjørn Erik Pedersen
See #5324
2018-02-12parser: Add WARNING for integer YAML keysBjørn Erik Pedersen
```bash benchmark old ns/op new ns/op delta BenchmarkStringifyMapKeysStringsOnlyInterfaceMaps-4 3053 2015 -34.00% BenchmarkStringifyMapKeysStringsOnlyStringMaps-4 5.23 5.18 -0.96% BenchmarkStringifyMapKeysIntegers-4 2320 5177 +123.15% benchmark old allocs new allocs delta BenchmarkStringifyMapKeysStringsOnlyInterfaceMaps-4 6 6 +0.00% BenchmarkStringifyMapKeysStringsOnlyStringMaps-4 0 0 +0.00% BenchmarkStringifyMapKeysIntegers-4 6 14 +133.33% benchmark old bytes new bytes delta BenchmarkStringifyMapKeysStringsOnlyInterfaceMaps-4 1008 1008 +0.00% BenchmarkStringifyMapKeysStringsOnlyStringMaps-4 0 0 +0.00% BenchmarkStringifyMapKeysIntegers-4 1008 1776 +76.19% ``` Closes #4393
2018-02-12parser: Tune stringifyMapKeysBjørn Erik Pedersen
```bash benchmark old ns/op new ns/op delta BenchmarkStringifyMapKeysStringsOnlyInterfaceMaps-4 3269 3053 -6.61% BenchmarkStringifyMapKeysStringsOnlyStringMaps-4 4.79 5.23 +9.19% BenchmarkStringifyMapKeysIntegers-4 2707 2320 -14.30% benchmark old allocs new allocs delta BenchmarkStringifyMapKeysStringsOnlyInterfaceMaps-4 16 6 -62.50% BenchmarkStringifyMapKeysStringsOnlyStringMaps-4 0 0 +0.00% BenchmarkStringifyMapKeysIntegers-4 16 6 -62.50% benchmark old bytes new bytes delta BenchmarkStringifyMapKeysStringsOnlyInterfaceMaps-4 1080 1008 -6.67% BenchmarkStringifyMapKeysStringsOnlyStringMaps-4 0 0 +0.00% BenchmarkStringifyMapKeysIntegers-4 1080 1008 -6.67% ```
2018-02-12parser: Rename stringifyYAMLMapKeys to stringifyMapKeysBjørn Erik Pedersen
2018-02-12Add support for YAML array data filesVas Sudanagunta
* Unmarshaled YAML arrays indistinguishable from JSON arrays. * Fixes #3890
2018-02-09parser: Fix YAML maps key typeDawid Gaweł
Recurse through result of yaml package parsing and change all maps from map[interface{}]interface{} to map[string]interface{} making them jsonable and sortable. Fixes #2441, #4083
2018-02-02Fix JSON array-based data file handling regressionVas Sudanagunta
This bug was introduced in Hugo 0.35. Fixes #4361
2018-01-26Support pages without front matterVas Sudanagunta
* Page without front matter now treated same as a page with empty front matter. * Test cases added to cover this and repro issue #4320. * Type safety of front matter code improved. Fixes #4320
2017-06-18create: Use archetype template as-is as a Go templateBjørn Erik Pedersen
This commit removes the fragile front matter decoding, and takes the provided archetype file as-is and processes it as a template. This also means that we no longer will attempt to fill in default values for `title` and `date`. The upside is that it is now easy to create these values in a dynamic way: ```toml +++ title = {{ .BaseFileName | title }} date = {{ .Date }} draft = true +++ ``` You can currently use all of Hugo's template funcs, but the data context is currently very shallow: * `.Type` gives the archetype kind provided * `.Name` gives the target file name without extension. * `.Path` gives the target file name * `.Date` gives the current time as RFC3339 formatted string The above will probably be extended in #1629. Fixes #452 Updates #1629
2017-06-03all: Temporarily revert to BurntSushi for TOML front matter handlingBjørn Erik Pedersen
We still have go-toml as a transitive dependency, and it is the way to go eventually, but we care about speed, so let us wait that one out. Note that the issue this fixes is about taxonomies, but I guess this is a general issue for sites with many pages that uses TOML as front matter. ``` benchmark old ns/op new ns/op delta BenchmarkFrontmatterTags/TOML:1-4 23206 8543 -63.19% BenchmarkFrontmatterTags/TOML:11-4 80117 18495 -76.92% BenchmarkFrontmatterTags/TOML:21-4 140676 28727 -79.58% benchmark old allocs new allocs delta BenchmarkFrontmatterTags/TOML:1-4 173 60 -65.32% BenchmarkFrontmatterTags/TOML:11-4 625 138 -77.92% BenchmarkFrontmatterTags/TOML:21-4 1106 210 -81.01% benchmark old bytes new bytes delta BenchmarkFrontmatterTags/TOML:1-4 9231 2912 -68.45% BenchmarkFrontmatterTags/TOML:11-4 19808 5184 -73.83% BenchmarkFrontmatterTags/TOML:21-4 31200 7536 -75.85% ``` See #3541 Updates #3464
2017-03-20parser: Improve TOML frontmatter parser performanceAlbert Nigmatzianov
Difference between toml.Load(string(datum)) and toml.LoadReader(bytes.NewReader(datum)): benchmark old ns/op new ns/op delta BenchmarkLoad-4 82068 78489 -4.36% benchmark old allocs new allocs delta BenchmarkLoad-4 494 493 -0.20% benchmark old bytes new bytes delta BenchmarkLoad-4 17009 16913 -0.56%
2017-03-15Update to new go-toml APIBjørn Erik Pedersen
Closes #3142
2017-03-11parser: Refactor frontmatter parser and add testsCameron Moore
Lots of cleanups here: - Refactor InterfaceToConfig and InterfaceToFrontMatter to use io.Writer. - Simplify InterfaceToFrontMatter by wrapping InterfaceToConfig. - Export FrontmatterType since we return it in DetectFrontMatter. - Refactor removeTOMLIdentifier to avoid blindly replacing "+++". - Update HandleJSONMetaData to return an empty map on nil input. - Updates vendored goorgeous package and test for org-mode frontmatter. - Add tests and godoc comments. Coverage for parser package increased from 45.2% to 85.2%.
2017-02-21all: Add org-mode supportChase Adams
Fixes #1483 See #936
2016-11-23commands, hugolib, parser, tpl: Use errors.New instead of fmt.Errorfbogem
2016-09-11parser: Simplify err conditionsbogem
2016-08-20Switch to a more up to date TOML libraryBjørn Erik Pedersen
Fixes #2089
2016-07-14Update frontmatter.goHenrique Dias
2016-04-26Export "detectFrontMatter" to fix caddy-hugoHenrique Dias
Closes #2108
2016-03-23parser: Spring code cleaningBjørn Erik Pedersen
2016-03-14parser: Unexport some internalsBjørn Erik Pedersen
2015-12-07Fix copyright headers in source filesBjørn Erik Pedersen
Still need to add some missing headers and an AUTHORS file. See #1646
2015-11-24Change the license to Apache 2.0Steve Francia
2015-03-11Correct initialisms as suggested by golintAnthony Fok
First step to use initialisms that golint suggests, for example: Line 116: func GetHtmlRenderer should be GetHTMLRenderer as see on http://goreportcard.com/report/spf13/hugo Thanks to @bep for the idea! Note that command-line flags (cobra and pflag) as well as struct fields like .BaseUrl and .Url that are used in Go HTML templates need more work to maintain backward-compatibility, and thus are NOT yet dealt with in this commit. First step in fixing #959.
2015-03-11parser: add some frontmatter test casesbep
2015-01-24Upgrade from gopkg.in/yaml.v1 to gopkg.in/yaml.v2Anthony Fok
2014-08-18switch to new location of goyamlAndrew Gerrand
2014-05-09Adding new commands (new site [path], new theme [name])spf13
2014-05-02adding a front matter format to lead rune methodspf13
2014-05-01moving front matter parsing (and creation) to parse packagespf13