πŸ’‹Kiss

Keep It Simply Static

Reference

Twig functions

path(name, params)

Generates URLs between routes :

{{ path('about') }}                          β†’ /about
{{ path('blog', {slug: 'hello'}) }}          β†’ /hello.html
{{ path('blog') }}                            β†’ /blog
{{ path('blog', {page: 2}) }}                 β†’ /blog/page/2

Trailing /index.html is automatically cleaned :

{{ path('index') }}                           β†’ /
{{ path('blog') }}                            β†’ /blog

route(name)

Access another route's resolved data :

{% set blog = route('blog') %}
<h1>{{ blog.title }}</h1>
{% for post in blog.items %}
  <a href="{{ path('blog', {slug: post.slug}) }}">{{ post.title }}</a>
{% endfor %}

asset(path)

Signed URLs with CRC32C hash for cache busting :

<link rel="stylesheet" href="{{ asset('css/style.css') }}">
<!-- β†’ /css/style.css?v=70a5a1d3 -->

dump(...)

VarDump helper (only in debug mode) :

{{ dump() }}
{{ dump(foo, bar) }}

Twig filters

markdown

Converts Markdown to HTML via league/commonmark (GFM) :

{{ content|markdown|raw }}

slugify

Converts a string into a URL-safe slug :

{{ 'Hello World'|slugify }}    β†’ hello-world
{{ section.title|slugify }}     β†’ ma-section

CLI commands

Command Description
kiss init [dir] Create a new site
kiss build Build the whole site
kiss watch Build then watch for changes
kiss route [list|name] List or rebuild routes
kiss copy [path] Sync a file from copy/ to web/
kiss reset [all|dist|cache] Remove web/ and/or tmp/
kiss test Validate configuration