summaryrefslogtreecommitdiffstats
path: root/hugolib/taxonomy.go
AgeCommit message (Collapse)Author
2022-04-12Make string sorting (e.g. ByTitle, ByLinkTitle and ByParam) language awareBjørn Erik Pedersen
Fixes #2180
2019-08-08Simplify page tree logicBjørn Erik Pedersen
This is preparation for #6041. For historic reasons, the code for bulding the section tree and the taxonomies were very much separate. This works, but makes it hard to extend, maintain, and possibly not so fast as it could be. This simplification also introduces 3 slightly breaking changes, which I suspect most people will be pleased about. See referenced issues: This commit also switches the radix tree dependency to a mutable implementation: github.com/armon/go-radix. Fixes #6154 Fixes #6153 Fixes #6152
2019-08-01Merge pull request #6149 from bep/sort-caseinsensitiveBjørn Erik Pedersen
Implement lexicographically string sorting
2019-04-15hugolib: Fix panic for unused taxonomy content filesBjørn Erik Pedersen
In Hugo 0.55 we connected the taxonomy nodes with their owning Page. This failed if you had, say, a content file for a author that did not author anything in the site: ``` content/authors/silent-persin/_index.md ``` Fixes #5847
2019-04-13Fix WeightedPages in union etc.Bjørn Erik Pedersen
We introduced a callback func() to get the owner Page in 0.55.0. Sadly, funcs is not comparable type in Go. This commit replaces the func with a struct pointer that wraps the Page. Fixes #5850
2019-03-23Make Page an interfaceBjørn Erik Pedersen
The main motivation of this commit is to add a `page.Page` interface to replace the very file-oriented `hugolib.Page` struct. This is all a preparation step for issue #5074, "pages from other data sources". But this also fixes a set of annoying limitations, especially related to custom output formats, and shortcodes. Most notable changes: * The inner content of shortcodes using the `{{%` as the outer-most delimiter will now be sent to the content renderer, e.g. Blackfriday. This means that any markdown will partake in the global ToC and footnote context etc. * The Custom Output formats are now "fully virtualized". This removes many of the current limitations. * The taxonomy list type now has a reference to the `Page` object. This improves the taxonomy template `.Title` situation and make common template constructs much simpler. See #5074 Fixes #5763 Fixes #5758 Fixes #5090 Fixes #5204 Fixes #4695 Fixes #5607 Fixes #5707 Fixes #5719 Fixes #3113 Fixes #5706 Fixes #5767 Fixes #5723 Fixes #5769 Fixes #5770 Fixes #5771 Fixes #5759 Fixes #5776 Fixes #5777 Fixes #5778
2018-01-17resource: Add front matter metadata to ResourceBjørn Erik Pedersen
This commit expands the Resource interface with 3 new methods: * Name * Title * Params All of these can be set in the Page front matter. `Name` will get its default value from the base filename, and is the value used in the ByPrefix and GetByPrefix lookup methods. Fixes #4244
2017-05-09hubolib: Embed Page in WeightedPageBjørn Erik Pedersen
People can still say `.Page`, but by embedding it `WeightedPages` can be used interchangeably with `Pages` in templates. Fixes #3435
2017-02-04all: Refactor to nonglobal file systemsBjørn Erik Pedersen
Updates #2701 Fixes #2951
2016-11-22node to page: Remove NodeBjørn Erik Pedersen
And misc. TODO-fixes Updates #2297
2016-10-24Avoid reading from Viper for path and URL funcsBjørn Erik Pedersen
The gain, given the "real sites benchmark" below, is obvious: ``` benchmark old ns/op new ns/op delta BenchmarkHugo-4 14497594101 13084156335 -9.75% benchmark old allocs new allocs delta BenchmarkHugo-4 57404335 48282002 -15.89% benchmark old bytes new bytes delta BenchmarkHugo-4 9933505624 9721984424 -2.13% ``` Fixes #2495
2016-04-02Make ByCount sort consistentlyRobert Basic
When two or more taxonomies have the same number of pages, sort them by name to have consistent ByCount sorting of taxonomies. Fixes #1930
2016-03-24hugolib: Taxonomy GoDoc cleanupBjørn Erik Pedersen
2016-03-03Try both prepped and unprepped taxonomy keysBjørn Erik Pedersen
Fixes #1869
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-23Change the license to Apache 2.0Steve Francia
2015-09-01Add config option "disablePathToLower"chrongzhang
Enabling this prevents lowercasing of the path/url. Fixes #557
2015-05-31Add PreserveTaxonomyNames flagbep
Before this commit, taxonomy names were hyphenated, lower-cased and normalized -- then fixed and titleized on the archive page. So what you entered in the front matter isn't necessarily what you got in the final site. To preserve backwards compability, `PreserveTaxonomyNames` is default `false`. Setting it to `true` will preserve what you type (the first characters is made toupper for titles), but normalized in URLs. This also means that, if you manually construct URLs to the archive pages, you will have to pass the Taxonomy names through the `urlize` func. Fixes #1180
2015-05-12Allow to reverse taxonomy entries.David Calavera
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-07hugolib: apply some more Golint rulesbep
2014-11-27Adding Prev/Next functionality to all lists of pages (sections, taxonomies, etc)spf13
2014-09-11Sort by title if dates are the sameNate Finch
2014-09-09Change all uses of sort.Sort to sort.Stable.Using sort.Stable ensures that ↵Nate Finch
even if the sort keys are the same, the order of the sort will not randomly change. Using the old sort.Sort, if you had pages with no date, the lists of those pages would randomly reorder every time you regenerate the list, causing spurious changes to the output. Now they'll always get ordered in the same way.
2014-08-29Making the term "Term" more consistent with Taxonomy usage.spf13
2014-08-29Making the Pages Sorting methods available within a taxonomy term.spf13
2014-08-25preserve alias case while lowercasing taxonomyJoel Scoble
2014-04-09Renamed Indexes to Taxonomies. Old template and config parameters still work.spf13