| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
A static site generator that lets you build websites using Python and nitro-ui.
pip install nitro-cliAdd Nitro CLI knowledge to your AI coding assistant:
npx skills add nitro-sh/nitro-cliThis enables AI assistants like Claude Code to understand Nitro CLI and generate correct nitro-ui code.
nitro new my-site
cd my-site
nitro devVisit http://localhost:3000. Build for production with nitro build.
Pages are Python files in src/pages/ that export a render() function:
# src/pages/index.py
from nitro_ui import HTML, Head, Body, Title, Meta, H1
from nitro import Page
def render():
return Page(
title="Home",
content=HTML(
Head(
Meta(charset="UTF-8"),
Meta(name="viewport", content="width=device-width, initial-scale=1.0"),
Title("Home"),
),
Body(H1("Welcome!"))
)
)Output paths mirror the file structure: src/pages/about.py → build/about.html
Generate multiple pages from data using [param].py naming:
# src/pages/blog/[slug].py
from nitro import Page
from nitro_datastore import NitroDataStore
def get_paths():
data = NitroDataStore.from_file("src/data/posts.json")
return [{"slug": p.slug, "title": p.title} for p in data.posts]
def render(slug, title):
return Page(title=title, content=...)| Command | Description |
|---|---|
| nitro new <name> | Create new project |
| nitro init | Initialize Nitro in current dir |
| nitro dev | Start dev server with live reload |
| nitro build | Build for production |
| nitro preview | Preview production build |
| nitro routes | List all routes |
| nitro check | Validate site without building |
| nitro export | Export site as zip archive |
| nitro clean | Remove build artifacts |
| nitro deploy | Deploy to hosting platform |
| nitro info | Show project and environment info |
Run nitro <command> --help for options.
# nitro.config.py
from nitro import Config
config = Config(
site_name="My Site",
base_url="https://mysite.com",
renderer={"minify_html": True},
plugins=[],
)This project is licensed under the BSD 3-Clause License. See the LICENSE file for details.
| Back | FazBrowse Home | New Git URL |