DocsTheme structure & publishing
On this page

Theme Routing

backend/paths.json lets a theme serve clean, dynamic URLs while still keeping pages as plain HTML files.

Place it in the backend/ folder inside the theme root:

text

The file is a JSON object. Each key is a public URL pattern, and each value is the HTML file that should handle that URL.

json

With this config:

Browser URLServed file$params
/users/ada/users/info.html{ "username": "ada" }
/users/ada/files/users/files.html{ "username": "ada" }
/users/ada/files/report-1/users/file.html{ "username": "ada", "id": "report-1" }

The browser URL stays clean. Frontbacked only rewrites the file used to serve the request.

Reading Params in FQL

When a route matches, Frontbacked injects the params into the page as window.$params. FQL reads them through $params.

index.html

For /users/ada, $params.username is ada, and the page can fetch the matching profile without parsing the URL manually.

Blog Example

Use one detail page for every article slug:

json
index.html

Now /blog/market-outlook and /blog/risk-guide can both use /blog/detail.html.

Route Order

Frontbacked checks routes in the order they appear in paths.json. Put more specific routes before broader routes.

json

This keeps /products/new from being treated as { "slug": "new" }.

What It Does Not Do

paths.json is for theme page routing. It does not create API routes, does not replace FRL permissions, and does not change how assets such as CSS, JS, images, or uploads should be referenced.

Use simple path segments and named params such as :slug, :username, or :id. Params match one URL segment at a time, so /blog/:slug matches /blog/market-outlook, not /blog/2026/market-outlook.

For query string values, use $query instead:

FQL state configuration

Add this configuration inside your page’s {STATE} declaration. Inspect state shows its configuration; live queries and saved data run against your local site. Try a complete FQL page →

Local Preview and Published Sites

Frontbacked uses the same backend/paths.json file when you preview a theme locally and when the site is published. That means the same route config works in local preview, site preview, and production.