Skip to content

mkkvkmn/bones

Repository files navigation

Bones - Static Site Generator

When Flesh and Muscles Are Too Much

A Python static site generator with multi-language and multi-site support.

Quick Start

  1. Setup VENV & Install Dependencies

    python -m venv venv
    venv\Scripts\activate
    python -m pip install --upgrade pip
    pip install -r requirements.txt
  2. Initialize New Site

    python init.py your-site-name
  3. Configure Environment

    # .env file
    DATA_FOLDER=data
    SITE_NAME=your-site-name
    BUILD_ENV=dev
  4. Build Site

    python gen.py                   # Development
    python gen.py --env prod        # Production
    python gen.py --verbose         # Debug output
    python gen.py -sfp content/posts/2025/2025-01-15-my-post/my-post.md  # Single file (fast)

Project Structure

root/
├── README.md
├── requirements.txt
├── gen.py                      # Main generator
├── .env                        # Environment configuration
│
├── themes/                     # Available themes
│   └── default/                # Default theme
│   │   ├── templates/          # Jinja2 templates
│   │   │   ├── base.html
│   │   │   ├── post.html
│   │   │   ├── page.html
│   │   │   ├── landing.html
│   │   │   ├── feed.xml
│   │   │   └── sitemap.xml
│   │   ├── assets/             # Theme assets
│   │   │   ├── css/
│   │   │   ├── fonts/
│   │   │   └── images/
│   │   └── partials/           # Template partials
│   │       ├── _macros.html
│   │       └── _schema.html
├── sites/                      # Site data directory
│   └── your-site/          # Site configuration
│       ├── config/
│       │   ├── build.yml   # Build settings
│       │   ├── content/    # Content configuration
│       │   │   ├── site.yml
│       │   │   ├── pages.yml
│       │   │   └── languages/
│       │   │       ├── fi.yml
│       │   │       └── en.yml
│       │   └── setup.json  # Generated config
│       ├── content/
│       │   ├── posts/       # Blog posts
│       │   │   └── 2024/
│       │   │       └── 2024-12-31-post-name/
│       │   │           ├── 2024-12-31-post-name.md
│       │   │           └── images/
│       │   └── pages/       # Static pages
│       │       ├── about/
│       │       └── landing/
│       └── assets/          # Site assets
│
└── z-public/                   # Generated output
    └── your-site/
        ├── dev/                # Development build
        └── prod/               # Production build

Configuration

Create a site with init.py and see the config folder. Generator creates a config object dynamically using the folders and .yml file names in the config folder (and sub folders).

Build Process

  1. Load Config: Environment and YAML files
  2. Discover Content: Scan content directories
  3. Process Content: Parse markdown, enrich metadata
  4. Generate Site: Render templates
  5. Validate Site: Check links and integrity

Commands

python init.py site-name        # Create new site
python gen.py                   # Build site
python gen.py --env prod       # Production build
python gen.py --verbose        # Debug output
python gen.py -sfp path/to/file.md  # Single file build (fast)

Single File Build

For large sites you can do fast iteration while writing posts.

Use the single file build mode:

python gen.py -s site-name -sf sites -sfp c:/site/content/posts/2025/2025-01-15-my-post/my-post.md
  • Use absolute file path
  • Fast
  • Skips dependencies and validation
  • Remember to do a full build before publishing

Requirements

  • Python 3.8+
  • See requirements.txt

About

When flesh and muscles are just too much

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published