Metadata-Version: 2.4
Name: pysitegen
Version: 1.2.1
Summary: A tiny Python-authored static site generator for terminal-inspired static web pages.
Author: Ujjwal Vivek
License-Expression: MIT
Project-URL: Homepage, https://pysitegen.ujjwalvivek.com
Project-URL: Repository, https://github.com/ujjwalvivek/pysitegen
Project-URL: Issues, https://github.com/ujjwalvivek/pysitegen/issues
Keywords: cli,html,python,static-site-generator,website
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Internet :: WWW/HTTP :: Site Management
Classifier: Topic :: Software Development :: Code Generators
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: dev
Requires-Dist: pytest>=8; extra == "dev"
Dynamic: license-file

# PySiteGen

<p align="left">
    <a href="https://pysitegen.ujjwalvivek.com/#docs"><img src="https://echopoint.ujjwalvivek.com/svg/badges/custom?bg=111111&badgeColor=0080ff&textColor=e8e8e8&border=0080c0&borderWidth=2&rx=0&px=2&py=2&logo=docs&leftText=getting+started&rightText=DOCS" alt="DOCS badge"></a>
    <a href="https://pypi.org/project/pysitegen/"><img src="https://echopoint.ujjwalvivek.com/svg/badges/custom?bg=111111&badgeColor=0080ff&textColor=e8e8e8&border=0080c0&borderWidth=2&rx=0&px=2&py=2&logo=python&leftText=PyPi&rightText=latest" alt="PyPi badge"></a>
</p>

PySiteGen is a tiny static site generator for people who would rather compose HTML with Python without any runtime server, client framework, or hidden build graph. PySiteGen gives you primitives. The default visual taste is just a theme layer with terminal-dark aesthetics. It is practical. You write Python functions that return HTML nodes. PySiteGen renders them to static HTML and copies the assets you explicitly ask for.

## Why This Exists?

- You see, my partner understands Python and web was a bit intimidating for them.
- So, I abstracted just enough web, for this to not become a crutch.
- And, build static sites with Python primitives.
- Because, every Python framework felt ...heavier and too abstracted.
- That's it. No "because I was tired of X, so I over-engineered this piece of crap Y".
- The irony.

## What Can You Build?

- Static landing pages
- Personal portfolio and resume sites
- Documentation sites
- Collection or showcase pages
- SPA-style sites with hash routes

The framework gives you primitives. Your project owns the structure.

## Project Layout

```bash

# generated by pysitegen init
my-site/
  index.py
  assets/index.css
  content/docs/.gitkeep
  static/
    favicon.png
    robots.txt
  .gitignore
  README.md

# produces plain output files
# easily hostable
my-site/
  public/
    index.html
    assets/index.css
    favicon.png
    robots.txt
```

Works for docs sites, small product or project pages, personal sites, link hubs, simple SPA-style hash routes, and static pages that benefit from Python data and composition.

## Build And Preview

```bash

# Install PySiteGen from PyPI
python -m pip install pysitegen
pysitegen --version

# Create a new site
pysitegen init my-site
cd my-site
pysitegen serve

# static server without watching or browser reload
pysitegen serve --no-reload
```

## A Page

```python
from pysitegen import a, default_dark, h1, p, page, section

def build():
    return page(
        section(
            p("PySiteGen", class_="eyebrow"),
            h1("Hello from Python."),
            p("This is a static page generated from Python primitives.", class_="muted"),
            a("Read more", href="#more", class_="button primary"),
            class_="container stack",
        ),
        title="Hello",
        description="A PySiteGen page.",
        theme=default_dark(),
    )
```

Build it and serve it.

## This Repo

This repository contains the package source, tests, and the `PySiteGen` website:

```bash
src/pysitegen/  package source and bundled framework assets
tests/          fixture-based behavior tests
website/        PySiteGen website source
```

Develop locally:

```bash
python -m pip install -e .[dev]
python -m pytest
# Build and serve the website
```

Do not edit `website/public/` as source.
