1
0
mirror of https://github.com/gohugoio/hugo.git synced 2024-05-11 05:54:58 +00:00

7 Commits

Author SHA1 Message Date
9e57182705 tests: Convert from testify to quicktest 2019-08-12 13:26:32 +02:00
4494a01b79 metrics: Adjust the howSimilar logic vs strings
Also add a test.
2019-04-02 21:00:42 +02:00
a55640de8e tpl: Allow the partial template func to return any type
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-04-02 10:30:24 +02:00
01e54609e7 metrics: Reset benchmark timer 2017-10-07 20:41:25 +02:00
5800a20a25 metrics: Detect partialCached candidates
This commit adds a "cache potential" column when running `hugo --templateMetrics --templateMetricsHints`.

This is only calculated when `--templateMetricsHints` is set, as these calculations has an negative effect on the other timings.

This gives a value for partials only, and is a number between 0-100 that indicates if `partial` can be replaced with `partialCached`.

100 means that all execution of the same partial resulted in the same output.

You should do  some manual research before going "all cache".
2017-10-07 18:00:07 +02:00
d3681f51c0 metrics: Fix sort order
Highest first.
2017-09-26 20:31:40 +02:00
b4a14c25fe metrics: Add simple template metrics feature 2017-09-26 20:03:04 +02:00