From 2afe07477195f0ffd15396770bcd769b57d5cdb8 Mon Sep 17 00:00:00 2001 From: Artem Sidorenko Date: Mon, 3 Jul 2017 00:20:49 +0200 Subject: [PATCH] tpl/math: Add log function It might be very useful for building tag clouds. --- content/templates/functions.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/content/templates/functions.md b/content/templates/functions.md index 0c6968bd2..99fb56d68 100644 --- a/content/templates/functions.md +++ b/content/templates/functions.md @@ -432,6 +432,12 @@ favicon.ico: {{.Width}} x {{.Height}} {{div 6 3}} → 2 + +math.Log +Natural logarithm of one float. +{{math.Log 1.0}} → 0 + + mod Modulus of two integers. @@ -714,7 +720,7 @@ e.g. * `{{ "this is a text" | truncate 10 " ..." }}` → `this is a ...` * `{{ "Keep my HTML" | safeHTML | truncate 10 }}` → `Keep my …` -* `{{ "With [Markdown](#markdown) inside." | markdownify | truncate 10 }}` → `With Markdown …` +* `{{ "With [Markdown](#markdown) inside." | markdownify | truncate 10 }}` → `With Markdown …` ### split