hugo/hugolib
Bjørn Erik Pedersen b08d9f26ae Make replaceShortcodeTokens rewrite the input slice
Currently a `[]byte` copy is returned. In most cases this is the safe thing to do, but we should just modify/grow the slice as needed.

This is faster and consumes less memory:

```
benchmark                             old ns/op     new ns/op     delta
BenchmarkReplaceShortcodeTokens-4     7350          4419          -39.88%

benchmark                             old allocs     new allocs     delta
BenchmarkReplaceShortcodeTokens-4     5              1              -80.00%

benchmark                             old bytes     new bytes     delta
BenchmarkReplaceShortcodeTokens-4     4816          1152          -76.08%
```

This commit is aso a small spring cleaning of duplicated code in the different `PageConvert` methods.

Fixes #1516
2015-11-17 18:24:17 +01:00
..
author.go
benchmark_test.go
datafiles_test.go
handler_base.go
handler_file.go
handler_meta.go
handler_page.go Make replaceShortcodeTokens rewrite the input slice 2015-11-17 18:24:17 +01:00
handler_test.go
hugo.go
media.go
menu.go Use Identifier as last sort resort for default menu sort 2015-11-09 21:02:21 +01:00
menu_test.go
node.go Add Param(key) to Node and Page 2015-10-12 06:11:01 +02:00
page.go Make replaceShortcodeTokens rewrite the input slice 2015-11-17 18:24:17 +01:00
page_permalink_test.go
page_taxonomy_test.go
page_test.go Export Page.Layout 2015-11-02 17:24:50 +01:00
page_time_integration_test.go
pageCache.go
pageCache_test.go
pageGroup.go Fix GroupByParam to return original param string 2015-11-10 14:57:03 +01:00
pageGroup_test.go Fix GroupByParam to return original param string 2015-11-10 14:57:03 +01:00
pageSort.go
pageSort_test.go
pagesPrevNext.go
pagesPrevNext_test.go
pagination.go
pagination_test.go
path_separators_test.go Export Page.Layout 2015-11-02 17:24:50 +01:00
path_separators_windows_test.go
permalinks.go
permalinks_test.go
planner.go Export Page.Layout 2015-11-02 17:24:50 +01:00
redis.cn.md
rss_test.go
scratch.go
scratch_test.go
shortcode.go Make replaceShortcodeTokens rewrite the input slice 2015-11-17 18:24:17 +01:00
shortcode_test.go Make replaceShortcodeTokens rewrite the input slice 2015-11-17 18:24:17 +01:00
shortcodeparser.go Fix trivial typos in code 2015-11-16 07:15:17 -07:00
shortcodeparser_test.go
site.go simplify rssuri logic 2015-11-15 11:05:16 -05:00
site_show_plan_test.go
site_test.go
site_url_test.go
siteinfo_test.go
siteJSONEncode_test.go
sitemap.go
sitemap_test.go
summary.go
taxonomy.go
taxonomy_test.go