Documentation

Docs

Introduction

What is rune

Philosophy

Why rune

Architecture

Getting Started

Installation

Quick start

Project structure

The dev loop

Tutorial: build an app

1. Create the app

2. Pages & routes

3. Layouts

4. State with Mimir

5. SSR & data

6. API routes

7. Styling

8. Build & deploy

Core Concepts

The application object

Rendering pipeline

Hydration

The build manifest

Configuration (ekko.json)

Permissions

Conventions

Routing

File-based routing

Dynamic routes

The router (useRouter)

Navigation & Link

Guards & redirects

Programmatic routes

Server-Side Rendering

Overview

The ssr() function

Strategies (eager/lazy)

SSR → hydration

Caching & invalidation

SEO

Mimir, state management

Overview

Atoms

Reading & writing

Selectors (derived state)

Subscriptions & the store

SSR & hydration

Persistence & sessions

Patterns & recipes

Pitfalls

Pages & Layouts

Pages

Layouts

Error & not-found

API Routes

Defining routes

Request & response

Middleware

helmet

cors

rateLimit

bodyLimit

validateContentType

csrf

requestId

timeout

errorHandler

httpsRedirect

secureCookies

ipFilter

safePath

Validation & options

Styling & Theming

SCSS

Theming (light/dark)

Asgard integration

No flash (no-FOUC)

Building & Deploying

The build

Static assets

Production deploy

API Reference

ekko:rune

ekko:rune/router

ekko:rune/mimir

ekko:rune/seo

ekko:ssr / css

ekko.json schema

CLI commands

Guides

Rune app from scratch

Recipes

Dark mode

Forms

Data fetching

Authentication

Pagination

FAQ (use cases)

Documentation

Docs

Introduction

What is rune

Philosophy

Why rune

Architecture

Getting Started

Installation

Quick start

Project structure

The dev loop

Tutorial: build an app

1. Create the app

2. Pages & routes

3. Layouts

4. State with Mimir

5. SSR & data

6. API routes

7. Styling

8. Build & deploy

Core Concepts

The application object

Rendering pipeline

Hydration

The build manifest

Configuration (ekko.json)

Permissions

Conventions

Routing

File-based routing

Dynamic routes

The router (useRouter)

Navigation & Link

Guards & redirects

Programmatic routes

Server-Side Rendering

Overview

The ssr() function

Strategies (eager/lazy)

SSR → hydration

Caching & invalidation

SEO

Mimir, state management

Overview

Atoms

Reading & writing

Selectors (derived state)

Subscriptions & the store

SSR & hydration

Persistence & sessions

Patterns & recipes

Pitfalls

Pages & Layouts

Pages

Layouts

Error & not-found

API Routes

Defining routes

Request & response

Middleware

helmet

cors

rateLimit

bodyLimit

validateContentType

csrf

requestId

timeout

errorHandler

httpsRedirect

secureCookies

ipFilter

safePath

Validation & options

Styling & Theming

SCSS

Theming (light/dark)

Asgard integration

No flash (no-FOUC)

Building & Deploying

The build

Static assets

Production deploy

API Reference

ekko:rune

ekko:rune/router

ekko:rune/mimir

ekko:rune/seo

ekko:ssr / css

ekko.json schema

CLI commands

Guides

Rune app from scratch

Recipes

Dark mode

Forms

Data fetching

Authentication

Pagination

FAQ (use cases)

Reference , ekko:rune/seo

SEO tag, robots, and sitemap generation. Import:

1
import { createSEO } from "ekko:rune/seo";

See SEO for the narrative.

createSEO(config) → seo

Config

1
2
3
4
5
6
7
8
9
createSEO({
site: { name?, url, language? },
meta: { title?, description?, keywords?, author?, robots?, canonical?, url?, og?, twitter? },
og: { type?, title?, description?, image?, imageWidth?, imageHeight?, url?, site_name? },
twitter: { card?, site?, title?, description?, image? },
favicon: { ico?, svg?, apple? },
robots: { allow?, disallow?, crawlDelay?, sitemap?, agents? },
sitemap: { routes?, dynamicRoutes? },
})
SectionPurpose
siteBase identity: name, url (required), language.
metaDefault document meta (description, keywords, author, robots, canonical).
ogDefault Open Graph tags.
twitterDefault Twitter Card tags.
faviconFavicon links (ico, svg, apple).
robotsrobots.txt config (allow/disallow, crawlDelay, sitemap, per-agent).
sitemapsitemap routes (static routes and/or dynamicRoutes()).

Returns seo with the methods below.

seo.headTags(overrides?) → string

Returns the <title>/<meta>/<link> HTML for <head>, site defaults merged with per-page overrides.

1
2
3
const head = `<style>${css}</style>${seo.headTags()}`;
// per page:
seo.headTags({ description: "...", canonical: "/x", og: { type: "article", image: "..." } });

Override fields: title, description, keywords, author, robots, canonical, url, og: { type, title, description, image, imageWidth, imageHeight, url, site_name }, twitter: { card, site, title, description, image }.

seo.robotsTxt() → string

The robots.txt body. Serve from an API route:

1
app.api("GET", "/robots.txt", (_req, res) => { res.header("Content-Type", "text/plain"); res.send(seo.robotsTxt()); });

seo.sitemapXml() → string

The sitemap XML. Serve from an API route:

1
app.api("GET", "/sitemap.xml", (_req, res) => { res.header("Content-Type", "application/xml"); res.send(seo.sitemapXml()); });

sitemap.routes are static entries ({ path, lastmod?, changefreq?, priority? }); sitemap.dynamicRoutes is a function returning more entries (e.g. one per content item).

seo.structuredData(jsonLd) → string

Wraps a JSON-LD object in a safely-escaped <script type="application/ld+json"> tag. Append to a page's head:

1
2
const ld = seo.structuredData({ "@context": "https://schema.org", "@type": "Article", headline: "..." });
export function ssr() { return { title: "...", head: head + ld }; }

Next: ekko:ssr & ekko:ssr/css.