Repo refactor: rename "website" to "docs"

This commit is contained in:
Zef Hemel
2026-06-23 09:12:24 +02:00
parent 1b3e86d960
commit e7ccdc2883
226 changed files with 1 additions and 1 deletions
+26
View File
@@ -0,0 +1,26 @@
#api/space-lua
Template functions that use the [[API/template#template.new(template)]] function.
## template.new(template, stripIndent)
Returns a template function that can be used to render a template. Conventionally, a template string is put between `[==[` and `]==]` as string delimiters.
If `stripIndent` is set to true or omitted, the function will try to remove indentation at the start of the line. This can be useful for multiline strings.
Example:
```space-lua
examples = examples or {}
examples.sayHello = template.new[==[Hello ${name}!]==]
```
And its use: ${examples.sayHello {name="Pete"}}
## template.each(collection, template)
Iterates over a collection and renders a template for each item.
Example:
${template.each(query[[from index.pages() limit 3]], template.new[==[
* ${name}
]==])}