docs: add doc for slicestr - hugo - [fork] hugo port for 9front
HTML git clone git@git.drkhsh.at/hugo.git
DIR Log
DIR Files
DIR Refs
DIR Submodules
DIR README
DIR LICENSE
---
DIR commit be4376a022abb4a0370a8a34847835839b3aa82e
DIR parent be2e08c4ade95e9aab4c891f867bd8f33519a101
HTML Author: bep <bjorn.erik.pedersen@gmail.com>
Date: Fri, 22 May 2015 22:20:35 +0200
docs: add doc for slicestr
See #1156
Diffstat:
M docs/content/templates/functions.md | 10 ++++++++++
1 file changed, 10 insertions(+), 0 deletions(-)
---
DIR diff --git a/docs/content/templates/functions.md b/docs/content/templates/functions.md
@@ -382,6 +382,16 @@ Example: Given `style = "color: red;"` defined in the front matter of your `.md`
Note: "ZgotmplZ" is a special value that indicates that unsafe content reached a
CSS or URL context.
+### slicestr
+
+Slicing in Slicestr is done by specifying a half-open range with two indices, start and end. 1 and 4 creates a slice including elements 1 through 3.
+The end index can be omitted, it defaults to the string's length.
+
+e.g.
+
+* `{{slicestr "BatMan" 3}}` → "Man"
+* `{{slicestr "BatMan" 0 3}}` → "Bat"
+
### title
Convert all characters in string to titlecase.