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
path: root/tpl
AgeCommit message (Collapse)Author
2019-12-12tpl: Add some commentsBjørn Erik Pedersen
2019-12-12Rework template handling for function and map lookupsBjørn Erik Pedersen
This is a big commit, but it deletes lots of code and simplifies a lot. * Resolving the template funcs at execution time means we don't have to create template clones per site * Having a custom map resolver means that we can remove the AST lower case transformation for the special lower case Params map Not only is the above easier to reason about, it's also faster, especially if you have more than one language, as in the benchmark below: ``` name old time/op new time/op delta SiteNew/Deep_content_tree-16 53.7ms ± 0% 48.1ms ± 2% -10.38% (p=0.029 n=4+4) name old alloc/op new alloc/op delta SiteNew/Deep_content_tree-16 41.0MB ± 0% 36.8MB ± 0% -10.26% (p=0.029 n=4+4) name old allocs/op new allocs/op delta SiteNew/Deep_content_tree-16 481k ± 0% 410k ± 0% -14.66% (p=0.029 n=4+4) ``` This should be even better if you also have lots of templates. Closes #6594
2019-12-12Create lightweight forks of text/template and html/templateBjørn Erik Pedersen
This commit also removes support for Ace and Amber templates. Updates #6594
2019-12-11Deprecate Ace and AmberBjørn Erik Pedersen
Fixes #6609
2019-12-03tpl/partials: Allow any key type in partialCachedBjørn Erik Pedersen
Fixes #6572
2019-11-27tpl/tplimpl: Featured and Site.Params image support for SchemaMax Arnold
2019-11-26tpl/tplimpl: Add support for featured and global image to OpenGraph templateMax Arnold
2019-11-26Fix language handling in ExecuteAsTemplateBjørn Erik Pedersen
Fixes #6331
2019-11-23Add Goldmark as the new default markdown handlerBjørn Erik Pedersen
This commit adds the fast and CommonMark compliant Goldmark as the new default markdown handler in Hugo. If you want to continue using BlackFriday as the default for md/markdown extensions, you can use this configuration: ```toml [markup] defaultMarkdownHandler="blackfriday" ``` Fixes #5963 Fixes #1778 Fixes #6355
2019-11-22Fix Params case handling in the index, sort and where funcBjørn Erik Pedersen
This means that you can now do: ``` {{ range where .Site.Pages "Params.MYPARAM" "foo" }} ```
2019-11-22Fix GetPage Params case issueBjørn Erik Pedersen
Fixes #5946
2019-11-11tpl/collections: Allow dict to create nested structuresBjørn Erik Pedersen
Fixes #6497
2019-11-11tpl/collections: Add collections.ReverseBjørn Erik Pedersen
Fixes #6499
2019-11-11tpl/collections: Make index work with slice as the last argBjørn Erik Pedersen
Fixes #6496
2019-11-06Prepare for GoldmarkBjørn Erik Pedersen
This commmit prepares for the addition of Goldmark as the new Markdown renderer in Hugo. This introduces a new `markup` package with some common interfaces and each implementation in its own package. See #5963
2019-11-04tpl/collections: Add some index map test casesBjørn Erik Pedersen
See #3974
2019-10-12tpl: Add optional "title" attribute to iframe in Vimeo shortcodeZach Bayoff
Add an optional "title" attribute to the iframe in the vimeo shortcode. If one is not given, the title attribute will default to "vimeo video". It is imperative for iframes to have a non-empty "title" attribute in order to meet WCAG2.0 accessibility guidelines https://www.w3.org/TR/WCAG20-TECHS/H64.
2019-10-12tpl: Modify error messages of after, first, and lastBaibhav Vatsa
Modified the messages functions after, first, and last threw on being passed invalid parameters (index or limit) to be more standardised and resemble what Go compiler would throw. Fixes #6415
2019-10-11tpl: Last now accepts 0 as limitBaibhav Vatsa
Modified the if conditional because of which last threw an error if 0 was passed as limit. The function now returns an empty slice if it is called with 0 as limit. The behavior of first and last is now the same when 0 is passed as limit. Also added tests to test the new behavior. Fixes #6419
2019-10-11tpl: After now accepts 0 as indexBaibhav Vatsa
Modified the if conditional because of which after threw an error if called with 0 as index. The function now returns the whole original slice if 0 is passed as an index. Also added tests to test the new behavior. Fixes #6388
2019-10-10tpl: Make getJSON/getCVS accept non-string argsBjørn Erik Pedersen
This broke for the Twitter simple shortcode now that Shortcodes accepts typed arguments. Fixes #6382
2019-10-05deps: Upgrade to latest version of emoji dependencyJamie Tanna
To add support for new emojis in Hugo, we need to upgrade our internal dependency on the emoji package. Note that we also need to update our tests, as the underlying emoji that is rendered has changed. Follow-up to #6391. (170f18d9352d39213170dd9d5e947eb45854c84b and 2df5d202c6fc6eb18ee0b259c3dd1156094947c5)
2019-09-30Support typed bool, int and float in shortcode paramsBjørn Erik Pedersen
This means that you now can do: {{< vidur 9KvBeKu false true 32 3.14 >}} And the boolean and numeric values will be converted to `bool`, `int` and `float64`. If you want these to be strings, they must be quoted: {{< vidur 9KvBeKu "false" "true" "32" "3.14" >}} Fixes #6371
2019-09-21tpl: Add `rel="noopener"` for external linksXhmikosR
This could be a security and performance issue. See https://developers.google.com/web/tools/lighthouse/audits/noopener
2019-09-21tpl: Remove unneeded spaceXhmikosR
2019-09-05tpl: Remove eq argument limitationVazrupe (HyeonGyu Lee)
Fixes #6237
2019-09-04Allow slices in the image Filter funcs, not just varargsBjørn Erik Pedersen
[ci skip] See #6255
2019-08-30tpl: Migrate last shortcodes (YouTube and Vimeo) to HTTPS embedsJake Jarvis
2019-08-28Add a set of image filtersBjørn Erik Pedersen
With this you can do variants of this: ``` {{ $img := resources.Get "images/misc/3-jenny.jpg" }} {{ $img := $img.Resize "300x" }} {{ $g1 := $img.Filter images.Grayscale }} {{ $g2 := $img | images.Filter (images.Saturate 30) (images.GaussianBlur 3) }} ``` Fixes #6255
2019-08-26Image resource refactorBjørn Erik Pedersen
This commit pulls most of the image related logic into its own package, to make it easier to reason about and extend. This is also a rewrite of the transformation logic used in Hugo Pipes, mostly to allow constructs like the one below: {{ ($myimg | fingerprint ).Width }} Fixes #5903 Fixes #6234 Fixes #6266
2019-08-17tpl: Use RegularPages for RSS templateBjørn Erik Pedersen
This is in line with how it was in Hugo 0.56. See #6238
2019-08-17tpl: Avoid "home page warning" in RSS templateBjørn Erik Pedersen
See #6238
2019-08-13Add resources.Match and resources.GetMatchBjørn Erik Pedersen
Fix #6190
2019-08-12tests: Convert from testify to quicktestBjørn Erik Pedersen
2019-08-10Avoid unnecessary conversionsChristian Muehlhaeuser
No need to convert these types.
2019-08-10Fixed ineffectual assignmentsChristian Muehlhaeuser
Dropped/fixed ineffectual assignments after static code analysis.
2019-08-10Simplify codeChristian Muehlhaeuser
- Use bytes.Equal instead of bytes.Compare - Omit range's value where it's unused
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-01tpl: Regenerate templatesBjørn Erik Pedersen
2019-08-01tpl: Always load GitHub Gists over HTTPSChristian Oliff
2019-08-01Fix assorted typosXhmikosR
2019-08-01Merge pull request #6149 from bep/sort-caseinsensitiveBjørn Erik Pedersen
Implement lexicographically string sorting
2019-07-25Block symlink dir traversal for /staticBjørn Erik Pedersen
This is in line with how it behaved before, but it was lifted a little for the project mount for Hugo Modules, but that could create hard-to-detect loops.
2019-07-24Add Hugo ModulesBjørn Erik Pedersen
This commit implements Hugo Modules. This is a broad subject, but some keywords include: * A new `module` configuration section where you can import almost anything. You can configure both your own file mounts nd the file mounts of the modules you import. This is the new recommended way of configuring what you earlier put in `configDir`, `staticDir` etc. And it also allows you to mount folders in non-Hugo-projects, e.g. the `SCSS` folder in the Bootstrap GitHub project. * A module consists of a set of mounts to the standard 7 component types in Hugo: `static`, `content`, `layouts`, `data`, `assets`, `i18n`, and `archetypes`. Yes, Theme Components can now include content, which should be very useful, especially in bigger multilingual projects. * Modules not in your local file cache will be downloaded automatically and even "hot replaced" while the server is running. * Hugo Modules supports and encourages semver versioned modules, and uses the minimal version selection algorithm to resolve versions. * A new set of CLI commands are provided to manage all of this: `hugo mod init`, `hugo mod get`, `hugo mod graph`, `hugo mod tidy`, and `hugo mod vendor`. All of the above is backed by Go Modules. Fixes #5973 Fixes #5996 Fixes #6010 Fixes #5911 Fixes #5940 Fixes #6074 Fixes #6082 Fixes #6092
2019-07-15tpl/collections: Add Merge functionBjørn Erik Pedersen
Merges two maps recursively and returns a new one. Merge is case-insensitive. Fixes #5992
2019-06-26tpl/tplimpl: Regenerate templatesBjørn Erik Pedersen
2019-06-26Pagination - do not render href if no next itemMark Mandel
When using a html link checker with Hugo, this template consistently causes errors, as it renders `href=""` attributes when next/previous is disabled. This change makes it so that the `href` attribute is not rendered at all if `HasNext` is false - which is better semantically, and makes link checking far easier.
2019-06-10tpl/collections: Fix slice type handling in sortBjørn Erik Pedersen
The `sort` template func was producing a `[]page.Page` which did not work in `.Paginate`. Fixes #6023
2019-06-09tpl/collections: Unwrap any interface value in sort and whereBjørn Erik Pedersen
Hugo `0.55.0` introduced some new interface types for `Page` etc. This worked great in general, but there were cases where this would fail in `where` and `sort`. One such example would be sorting by `MenuItem.Page.Date` where `Page` on `MenuItem` was a small subset of the bigger `page.Page` interface. This commit fixes that by unwrapping such interface values. Fixes #5989
2019-05-30tpl/collections: Convert numeric values to float64 and compare themAnton Harniakou
Fixes #5685