Commit graph

956 commits

Author SHA1 Message Date
Bjørn Erik Pedersen a0b3d9db16 hugolib: Add temporary date parse test
To debug the irregular Windows test failure.

See #3059
2017-02-19 13:19:15 +01:00
Bjørn Erik Pedersen 2ea242d5fe hugolib: Minor Go vet fix 2017-02-19 10:33:28 +01:00
Anton Staaf 99fbc75e7a hugolib: Fix regression of .Truncated evaluation in manual summaries
This fixes the behavior of .Truncated that was introduced with commit
bef496b97e which was later broken.  The
desired behavior is that .Truncated would evaluate to false when there
was nothing after the user defined summary marker.

This also adds a simple unit test to ensure that this feature isn't
broken again.  The check for content after the user defined summary
marker is done on the raw content instead of the working copy because
some of the markup renderers add elements after the marker, making it
difficult to determine if there is actually any content.

The behavior (evaluating to false when there is no content, just
summary) is also now documented.
2017-02-19 10:11:49 +01:00
Bjørn Erik Pedersen 9416fdd334 hugolib: Add missing page kind to allKinds 2017-02-19 09:15:30 +01:00
John Feminella b2e3748a4e hugolib: Enhance .Param to permit arbitrarily nested parameter references
The Param method currently assumes that its argument is a single,
distinct, top-level key to look up in the Params map. This enhances the
Param method; it will now also attempt to see if the key can be
interpreted as a nested chain of keys to look up in Params.

Fixes #2598
2017-02-19 08:50:08 +01:00
Bjørn Erik Pedersen 6d2281c8ea hugolib: Add disableKinds option
Fixes #2534
2017-02-18 22:53:23 +01:00
Bjørn Erik Pedersen 4493e8ed9f hugolib: Fix issue with taxonomies when only some have content page
Fixes #2992
2017-02-18 08:37:11 +01:00
Bjørn Erik Pedersen 07ab7ae3d2 hugolib: More test helper cleanup 2017-02-18 07:53:25 +01:00
Bjørn Erik Pedersen ed847ed93d hugolib: Test helper cleanup 2017-02-17 20:52:50 +01:00
Cameron Moore 10c13f5d79 hugolib: Make RSS item limit configurable
Add a new rssLimit site configuration option with default of 15.  Prior
to this fix, you could create your own RSS feed to override the default
limit of 15, but we still had a hardcoded limit of 50 items set in
`hugolib.renderRSS()`.

With this option in place, the `range first 15 .Data.Pages` logic is no
longer hardcoded into the embedded RSS template.

Because the size of the slice passed to the template is now limited to
rssLimit instead of 50, this commit is a breaking change for sites
with a custom RSS template that expects more than 15 items.

Fixes #3035
2017-02-17 19:53:08 +01:00
Bjørn Erik Pedersen ade207635e hugolib: Fix Windows build failure, final take 2017-02-17 18:34:58 +01:00
Bjørn Erik Pedersen 0946630715 hugolib: Fix Windows build failure, take 2 2017-02-17 18:28:14 +01:00
Bjørn Erik Pedersen 9421690281 hugolib: Fix Windows build failure 2017-02-17 18:22:36 +01:00
Bjørn Erik Pedersen 53d07fb409 hugolib: Add test case for empty Pages in regular pages
Fixes #2947
2017-02-17 17:26:09 +01:00
Bjørn Erik Pedersen 04a4a193a9 hugolib: Remove deprecated marked for removal
Fixes #3029
2017-02-17 17:20:46 +01:00
Bjørn Erik Pedersen 77cbe4d60b tplimpl: Refactor imageConfig into a struct
Updates #2701
2017-02-17 17:15:26 +01:00
Bjørn Erik Pedersen c507e2717d tpl: Refactor package
Now:

* The template API lives in /tpl
* The rest lives in /tpl/tplimpl

This is bound te be more improved in the future.

Updates #2701
2017-02-17 17:15:26 +01:00
Bjørn Erik Pedersen 93ca7c9e95 all: Refactor to nonglobal Viper, i18n etc.
This is a final rewrite that removes all the global state in Hugo, which also enables
the use if `t.Parallel` in tests.

Updates #2701
Fixes #3016
2017-02-17 17:15:26 +01:00
Bjørn Erik Pedersen 691156c5ba Use OS fs by default
Fixes #3032
2017-02-15 10:00:34 +01:00
Bjørn Erik Pedersen 234273a5b5 Deprecate sourceRelativeLinks
Fixes #3028
Closes #3026
Closes #2891
Closes #2691
2017-02-11 16:51:22 +07:00
John Feminella 298ebc37c2 hugolib: Add ability to sort by frontmatter parameters 2017-02-10 20:01:25 +07:00
Bjørn Erik Pedersen 2618cfbeaa hugolib: Fix error for non-renderable HTML content with shortcodes
This commit re-introduces template lookup order that was accidently removed as
part of the template nonglobal refactoring.

Fixes #3021
2017-02-10 18:57:38 +07:00
Bjørn Erik Pedersen 25bfa7e12f hugolib: Use the site's Tmpl for non-renderable pages 2017-02-10 10:44:35 +07:00
John Feminella 962443ade8 hugolib: Correct repeated spelling errors in documentation 2017-02-09 10:48:07 +01:00
Bjørn Erik Pedersen f404603340 Revert "hugolib: Add some baseof test variants"
This reverts commit d11f37d97c.

Will have to look more closely into this.

See #2995
2017-02-07 02:04:12 +07:00
Bjørn Erik Pedersen d11f37d97c hugolib: Add some baseof test variants
See #2995
2017-02-07 00:01:28 +07:00
bogem faba90ab96 helpers: Fix misspells 2017-02-04 22:28:36 +01:00
Bjørn Erik Pedersen 19aff029b1 hugolib: Skip rendering for the page tests 2017-02-04 23:15:07 +07:00
Bjørn Erik Pedersen c71e1b106e all: Refactor to nonglobal file systems
Updates #2701
Fixes #2951
2017-02-04 11:37:25 +07:00
Bjørn Erik Pedersen d6000a208c all: Refactor to nonglobal template handling
Updates #2701
2017-01-10 01:36:59 +01:00
Bjørn Erik Pedersen 4ea4359ac1 hugolib: Avoid double-encoding of paginator URLs
Fixes #2177
2017-01-08 17:13:46 +01:00
Bjørn Erik Pedersen 45e3ed517a all: Refactor to non-global logger
Note that this looks like overkill for just the logger, and that is correct,
but this will make sense once we start with the template handling etc.

Updates #2701
2017-01-07 17:06:35 +01:00
magikstm 56c5eadc38 hugolib: Remove summary.go
Became obsolete after refactoring.

Fixes #2888.
2017-01-06 16:40:51 +01:00
Cameron Moore 3d058a936f hugolib: Allow arrays of arrays in frontmatter Params
Fixes #2752
2017-01-06 11:56:22 +01:00
Bjørn Erik Pedersen 9f20e648b9 hugolib: Sync page collections with Site.Info on rebuild in watch mode
There is definitive potential for cleanup in this area, but this will have to do for now.

Fixes #2869
2017-01-05 20:57:24 +01:00
magikstm 01ee525f47 hugolib: Correct usage of "shortcode" in error messages 2017-01-05 15:40:28 +01:00
Daniel Lang 2127203ae3 Update documentation and test for sitemap template 2017-01-03 17:11:22 +01:00
Cameron Moore cb63e87f8d hugolib: Clean up a benchmark 2017-01-03 17:08:59 +01:00
Bjørn Erik Pedersen 5834efd5fd hugolib: Add a taxonomy test case 2017-01-02 12:28:26 +01:00
David Kassa 09a0af94f5 Fix Appveyor Windows build and GitInfo path issue on Windows 2017-01-01 23:16:58 +01:00
Bjørn Erik Pedersen 6e0f326b9d hugolib: Deprecate Page.Now
Use `now` (template func).

See cabc6b3186
2017-01-01 13:10:36 +01:00
Bjørn Erik Pedersen 695be00c07 hugolib: Bump the current warning deprecations
Fixes #2836
2017-01-01 12:36:21 +01:00
Bjørn Erik Pedersen bcb3ef7413 hugolib: Fix preserveTaxonomyNames regressions
Fixes #2809
2016-12-28 13:44:55 +01:00
Bjørn Erik Pedersen 88b5bbd532 hugolib: Fix IsTranslated for "old" node types
The new logic for creating Page objects from old node types
didn't include itself in the translation logic, so
`IsTranslated` returned falsely false for sites with only two languages.

The `AllTranslations` method also returned too few pages in that case.

This commit fixes that.

Fixes #2812
2016-12-27 12:01:54 +01:00
Cameron Moore d1b89f5c7c hugolib: Use reflect.DeepEqual in tests 2016-12-27 11:19:25 +01:00
Cameron Moore 17f851780c hugolib: Fix redundant URL file extension on taxonomy terms pages
Fixes #2819
2016-12-27 11:18:47 +01:00
Bjørn Erik Pedersen 7d991ed89c hugolib: Make template error messages more verbose
Fixes #2820
2016-12-26 14:52:31 +01:00
Bjørn Erik Pedersen 1881f60a16 hugolib: Add a test assertion for IsTranslated
See #2812
2016-12-21 10:17:05 +01:00
Bjørn Erik Pedersen a3a67163f9 hugolib: Enable override of theme base template only
This commit fixes the base template lookup order to match the behaviour of regular templates.

```
1. <current-path>/<template-name>-baseof.<suffix>, e.g. list-baseof.<suffix>.
2. <current-path>/baseof.<suffix>
3. _default/<template-name>-baseof.<suffix>, e.g. list-baseof.<suffix>.
4. _default/baseof.<suffix>

For each of the steps above, it will first look in the project, then, if theme is set,
in the theme's layouts folder.
```

Fixes #2783
2016-12-15 21:35:38 +01:00
Bjørn Erik Pedersen 83c6806576 Fix menu URL for node type pages
By delaying the menu assembly.

Fixes #2770
2016-12-11 16:16:24 +01:00