mirror of
https://github.com/gohugoio/hugo.git
synced 2026-08-24 15:28:54 +00:00
tpl/math: Add log function
It might be very useful for building tag clouds.
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
ab4e5da810
commit
2afe074771
@@ -432,6 +432,12 @@ favicon.ico: {{.Width}} x {{.Height}}
|
|||||||
<td><code>{{div 6 3}}</code> → 2</td>
|
<td><code>{{div 6 3}}</code> → 2</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td><code>math.Log</code></td>
|
||||||
|
<td>Natural logarithm of one float.</td>
|
||||||
|
<td><code>{{math.Log 1.0}}</code> → 0</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td><code>mod</code></td>
|
<td><code>mod</code></td>
|
||||||
<td>Modulus of two integers.</td>
|
<td>Modulus of two integers.</td>
|
||||||
@@ -714,7 +720,7 @@ e.g.
|
|||||||
|
|
||||||
* `{{ "this is a text" | truncate 10 " ..." }}` → `this is a ...`
|
* `{{ "this is a text" | truncate 10 " ..." }}` → `this is a ...`
|
||||||
* `{{ "<em>Keep my HTML</em>" | safeHTML | truncate 10 }}` → `<em>Keep my …</em>`
|
* `{{ "<em>Keep my HTML</em>" | safeHTML | truncate 10 }}` → `<em>Keep my …</em>`
|
||||||
* `{{ "With [Markdown](#markdown) inside." | markdownify | truncate 10 }}` → `With <a href='#markdown'>Markdown …</a>`
|
* `{{ "With [Markdown](#markdown) inside." | markdownify | truncate 10 }}` → `With <a href='#markdown'>Markdown …</a>`
|
||||||
|
|
||||||
### split
|
### split
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user