summaryrefslogtreecommitdiffstats
path: root/hugolib
AgeCommit message (Collapse)Author
2019-05-04i18n: Move the package below /langsBjørn Erik Pedersen
To get fewer top level packages.
2019-05-03hugolib: Disable racy testBjørn Erik Pedersen
See #5926
2019-05-02output: Fix permalink in sitemap etc. when multiple permalinkable output formatsBjørn Erik Pedersen
In Hugo 0.55.0 we made AMP `permalinkable`. We also render the output formats in their natural sort order, meaning `AMP` will be rendered before `HTML`. References in the sitemap would then point to the AMP version, and this is normally not what you'd want. This commit fixes that by making `HTML` by default sort before the others. If this is not you want, you can set `weight` on the output format configuration. Fixes #5910
2019-05-01hugolib: Fix PrevInSection/NextInSection for nested sectionsBjørn Erik Pedersen
This was broken in Hugo 0.55.0. Fixes #5883
2019-04-24hugolib: Fix shortcode version=1 logicBjørn Erik Pedersen
Fixes #5831
2019-04-24hugolib: Avoid recloning of shortcode templatesBjørn Erik Pedersen
```bash benchmark old ns/op new ns/op delta BenchmarkSiteNew/Bundle_with_image-4 14572242 14382188 -1.30% BenchmarkSiteNew/Bundle_with_JSON_file-4 13683922 13738196 +0.40% BenchmarkSiteNew/Multiple_languages-4 41912231 25192494 -39.89% benchmark old allocs new allocs delta BenchmarkSiteNew/Bundle_with_image-4 57496 57493 -0.01% BenchmarkSiteNew/Bundle_with_JSON_file-4 57492 57501 +0.02% BenchmarkSiteNew/Multiple_languages-4 242422 118809 -50.99% benchmark old bytes new bytes delta BenchmarkSiteNew/Bundle_with_image-4 3845077 3844065 -0.03% BenchmarkSiteNew/Bundle_with_JSON_file-4 3627442 3627798 +0.01% BenchmarkSiteNew/Multiple_languages-4 13963502 7543885 -45.97% ``` Fixes #5890
2019-04-22hugolib: No links for bundled pagesBjørn Erik Pedersen
This fixes a bug introduced in Hugo 0.55. Fixes #5882
2019-04-20Fix links for non-HTML output formatsBjørn Erik Pedersen
They were not correct for regular pages. Fixes #5877
2019-04-19hugolib: Add some OutputFormats.Get testsBjørn Erik Pedersen
See #5877
2019-04-19Fix menu URL when multiple permalinkable output formatsBjørn Erik Pedersen
In Hugo `0.55` we introduced the `permalinkable` config attribute on Output Format, default enabled for `AMP` and `HTML`. This meant that a Page could have different `RelPermalink` and `Permalink` depending on the rendering format. The menu `URL` did not reflect that fact. Fixes #5849
2019-04-19hugolib: Add some integration tests for in/uniq using PagesBjørn Erik Pedersen
See #5875 See #5852
2019-04-17hugolib: Add more tests for PermalinkableBjørn Erik Pedersen
See #5849
2019-04-17hugolib: Fix Pages reinitialization on rebuildsBjørn Erik Pedersen
Which had some unpredictable behaviour when using `.Pages` on home page etc. that had a content page. Fixes #5833
2019-04-15hugolib: Fix shortcode namespace issueBjørn Erik Pedersen
Fixes #5863
2019-04-15hugolib: Fix false WARNINGs in lang prefix checkBjørn Erik Pedersen
Add a slash to the check to make it less likely to match a valid value. Fixes #5860
2019-04-15hugolib: Fix bundle resource publishing when multiple output formatsBjørn Erik Pedersen
The faulty logic published the bundled resources for the "first output" format. This worked most of the time, but since the output formats list is sorted, any output format only used for some of the pages (e.g. CSS) would not work properly. Fixes #5858
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-13hugolib: Fix dates for sections with dates in front matterBjørn Erik Pedersen
Fixes #5854
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-04-12hugolib: Add a test for parent's resources in shortcodeBjørn Erik Pedersen
See #5833
2019-04-12FixBjørn Erik Pedersen
2019-04-12hugolib: Fix simple menu configBjørn Erik Pedersen
This stopped working in Hugo 0.55: ```bash --- menu: "main" --- ``` This was also the case for using a slice of menu entries. This still worked: --- menu: main: weight: 30 ---
2019-04-12Fix paginator refresh on server changeBjørn Erik Pedersen
Fixes #5838
2019-04-08Misc paginator adjustmentsBjørn Erik Pedersen
* Rewind paginator for server mode * Add some more related tests. * Replace the clumsy scratch constructs in internal paginator template with variables See #5825
2019-04-07hugolib: Log warning on relative front matter url with langBjørn Erik Pedersen
Will do this for one version only, as there may be situations where this is the correct thing. Also add some more related test cases. Fixes #5818
2019-04-05hugolib: Consider summary in front matter for .SummaryJim McDonald
Add the ability to have a `summary` page variable that overrides the auto-generated summary. Logic for obtaining summary becomes: * if summary divider is present in content, use the text above it * if summary variables is present in page metadata, use that * auto-generate summary from first _x_ words of the content Fixes #5800
2019-04-05hugolib: Fix default date assignment for sectionsBjørn Erik Pedersen
See #5784
2019-04-05Add HUGO_NUMWORKERMULTIPLIERBjørn Erik Pedersen
And use that to calculate number of workers, if set, else fall back to number of logical CPUs. Also tweak the relevant related settings to match the new setup. Also remove the setting of `runtime.GOMAXPROCS` as this has been the default behaviour since Go 1.5. Fixes #5814
2019-04-05hugolib: Fix the GOMAXPROCS env getBjørn Erik Pedersen
Fixes #5813
2019-04-05hugolib: Fix benchmark for YAML front matterBjørn Erik Pedersen
2019-04-04hugolib: Buffer the render pages chanBjørn Erik Pedersen
2019-04-04hugolib: Re-work "fast render" logic in the new flowBjørn Erik Pedersen
Note that this fixes some "live reload" issues recently introduced in non-released code. Closes #5811 See #5784
2019-04-02hugolib: Allow relative URLs in front matterBjørn Erik Pedersen
Before this commit you would have to do this in multilingual setups: ``` --- title: "Custom!" url: "/jp/custom/foo" --- ``` This commit allows for relative URLs, e.g: ``` --- title: "Custom!" url: "custom/foo" --- ``` Which is obviously easier and more portable. The meaning of relative may change to include more in the future (e.g. role based access). Fixes #5704
2019-04-02hugolib: Allow page-relative aliasesBjørn Erik Pedersen
Fixes #5757
2019-04-02tpl: Allow the partial template func to return any typeBjørn Erik Pedersen
This commit adds support for return values in partials. This means that you can now do this and similar: {{ $v := add . 42 }} {{ return $v }} Partials without a `return` statement will be rendered as before. This works for both `partial` and `partialCached`. Fixes #5783
2019-03-30hugolib: Fix alias path for AMP and similarBjørn Erik Pedersen
Fixes #5760
2019-03-28hugolib: Add a simple test for jsonify of SiteBjørn Erik Pedersen
Closes #5780
2019-03-26hugolib: Do not fall back to site title if not set in content fileBjørn Erik Pedersen
See #5784
2019-03-26hugolib: Add a test for home page with no titleBjørn Erik Pedersen
See #5784
2019-03-26Avoid nilpointer on no File on PageBjørn Erik Pedersen
Fixes #5781
2019-03-25hugolib: Add String() to fileInfoBjørn Erik Pedersen
See #5784
2019-03-25resources/page: Re-introduce .Page.PageBjørn Erik Pedersen
It was removed in 597e418cb02883418f2cebb41400e8e61413f651 -- it's not documented, but it's used in too many real sites on the web. See #5784
2019-03-24all: Apply staticcheck recommendationsBjørn Erik Pedersen
2019-03-24hugolib: Remove unused sliceBjørn Erik Pedersen
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
2019-03-12hugolib: Adjust site benchmarkBjørn Erik Pedersen
Having all the pages with shortcodes isn't realistic.
2019-02-19hugolib: Adjust test for Go 1.12Bjørn Erik Pedersen
2019-02-01Ignore unknown config files in config dirBjørn Erik Pedersen
Swap files etc. Fixes #5646
2019-02-01Store supported config formats in a variableAnton Harniakou
2019-01-31Fix some inline shortcode issuesBjørn Erik Pedersen
Fixes #5645 Fixes #5653