# posts

slug: getting-started
title: Getting Started
author: Admin
created_at: 2026-05-16 23:06:24
content:
Welcome to the blog! This is your first post.

Edit this post or create new ones from the **New Post** form. Posts support **bold**, *italic*, and `inline code`.

## Features

- Jinja2 templates with inheritance
- Markdown rendering
- Lua back-end scripts
- SQLite3 database


slug: lua-scripts
title: Working with Lua Scripts
author: Admin
created_at: 2026-05-16 23:06:24
content:
Lua scripts power the back-end logic for this blog.

## Request Handling

Define global functions named after HTTP methods:

```lua
function POST(req)
    local form, err = req:form()
    -- handle the form
    return 303, nil, {['Location'] = '/'}
end
```

## Database Access

```lua
local mydb, err = db.open('mydb.db')
local rows, err = mydb:query('SELECT * FROM posts')
```

The `fs`, `json`, `http`, and `os` modules are also available in the sandbox.


slug: markdown-pages
title: Markdown Pages
author: Admin
created_at: 2026-05-16 23:06:24
content:
This blog supports Markdown files rendered inside Jinja2 templates.

Create a `.md` file with an annotation comment:

    <!-- _base:content -->

    # My Post

    Markdown **content** here.

The annotation specifies the template name and block. The Markdown body is converted to HTML and injected into that block.

## Why Markdown?

- Write content without HTML
- Render inside any template block
- Full Jinja2 context available
- Great for documentation and blog posts


