💋Kiss

Keep It Simply Static

Data

Data sources

Files in data/ are loaded automatically and accessible via {{ global.* }}.

Supported formats : YAML, JSON, PHP, XML, INI, Markdown.

data/site.yml :

name: My Site
tagline: Great static site
{
  "name": "My Site",
  "tagline": "Great static site"
}
<?php
return [
  'name' => 'My Site',
  'tagline' => 'Great static site',
];
<?xml version="1.0"?>
<root>
  <name>My Site</name>
  <tagline>Great static site</tagline>
</root>
name = My Site
tagline = Great static site

Caching

Every data source is transformed into a PHP file and cached in /tmp/kiss/<hash>/datatree/.

How it works :

  1. A .yml, .json, .xml, .ini, .md or .php file is loaded
  2. The appropriate loader parses it (YamlLoader, JsonLoader, etc.)
  3. The result is serialized as a PHP file via var_export() and stored
  4. On subsequent builds, the cached PHP is included — no parsing needed
  5. When the source file changes, the cache is invalidated

Same mechanism for $ref and remote files :

items:
  $ref: https://api.example.com/posts.json

URLs are fetched once, cached as PHP, and served from cache on rebuilds until the resource changes.

Cache invalidation :

Markdown

---
title: My Article
date: 2024-01-01
---
Content **markdown** here.

Frontmatter fields are available directly, body as content :

<h1>{{ title }}</h1>
<div>{{ content|markdown|raw }}</div>