DocsBuild

Views

A view renders the response body for a page. Choose one format and put the file under src/routes/.

Not sure? Write a .nexy file. It needs no client framework, and you can add a React, Vue, Svelte, Solid or Preact component inside it later, as an island.

Which file for which page
server logic + HTML          →  .nexy      (Python frontmatter + Jinja2)
prose that changes rarely    →  .md        (GitHub-flavoured Markdown)
prose + components           →  .mdx       (React or Preact)
app-like page, client router →  .tsx .vue .svelte (framework files)
Python endpoint              →  .py        (GET, POST, …)

Formats

Format File Server render Client framework Notes
.nexy nexyfile.md Jinja2 + Python logic, streamed optional Native Nexy page format
.md markdown.md cmarkgfm at request time optional via layout Pure Markdown, GFM, layout-wrapped
.mdx markdown.md framework SSR React or Preact Markdown with components
.tsx, .jsx react.md or preact.md framework SSR / SSG React or Preact Component routes
.vue vue.md framework SSR / SSG Vue SFC routes
.svelte svelte.md framework SSR / SSG Svelte SFC routes

Built-in Image, Link, Audio, Video and Import helpers: components.md.

Enable a framework

Set useFF in nexyconfig.py and run nexy new to add dependencies:

nexyconfig.py
from nexy.core.models import NexyConfigModel
from nexy.frontend import react


class NexyConfig(NexyConfigModel):
    useFF = react()

With a framework enabled, its extensions become active routes and Vite handles client bundles.

Layouts

A layout.* in a directory wraps pages below it. See layouts.

Next steps

Edit on GitHub

Enter opens the result, Esc closes.