Metadata-Version: 2.4
Name: foliate
Version: 0.1.2
Summary: Minimal static site generator for markdown vaults
Project-URL: Homepage, https://github.com/yy/foliate
Project-URL: Repository, https://github.com/yy/foliate
Project-URL: Issues, https://github.com/yy/foliate/issues
Author: YY Ahn
License-Expression: MIT
Keywords: markdown,obsidian,static-site-generator,wiki
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: End Users/Desktop
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Internet :: WWW/HTTP :: Site Management
Classifier: Topic :: Text Processing :: Markup :: Markdown
Requires-Python: >=3.12
Requires-Dist: click>=8.0
Requires-Dist: jinja2>=3.1
Requires-Dist: markdown-katex>=202406.1035
Requires-Dist: markdown>=3.4
Requires-Dist: mdx-linkify>=2.1
Requires-Dist: mdx-wikilink-plus>=1.4
Requires-Dist: pygments>=2.15
Requires-Dist: python-frontmatter>=1.0.0
Requires-Dist: watchdog>=3.0
Provides-Extra: dev
Requires-Dist: pytest-cov>=4.0; extra == 'dev'
Requires-Dist: pytest>=7.0; extra == 'dev'
Requires-Dist: ruff>=0.1; extra == 'dev'
Description-Content-Type: text/markdown

# Foliate

A static site generator for your markdown vault. A flexible, configurable alternative to Obsidian Publish.

```bash
cd my-vault
uvx foliate init   # Create .foliate/config.toml
uvx foliate build  # Generate site to .foliate/build/
```

## Why Foliate?

- **Everything in your vault** - All content, config, and output stay in your vault
- **Single executable** - One tool to generate your website, no complex setup
- **Flexible** - Just markdown files in, a website out

## Features

- **Zero config** - Works out of the box with sensible defaults
- **Vault-native** - Everything lives in `.foliate/` inside your vault
- **Two-tiered visibility** - Control what's public vs. published
- **Incremental builds** - Only rebuilds changed files
- **Watch mode** - Auto-rebuild on file changes
- **Works with any markdown** - Obsidian, Logseq, or plain markdown files

## Quick Start

```bash
# Initialize in your vault
cd my-vault
uvx foliate init

# Build
uvx foliate build

# Watch mode (build + serve + auto-rebuild)
uvx foliate watch
```

## Directory Structure

```
my-vault/
├── .foliate/
│   ├── config.toml      # Configuration
│   ├── build/           # Generated site
│   ├── cache/           # Build cache
│   ├── templates/       # Custom templates (optional)
│   └── static/          # Custom CSS/JS (optional)
├── _private/            # Ignored - never built
├── _homepage/           # Site root (/, /about/, etc.)
│   └── about.md         # → example.com/about/
├── assets/              # Images, PDFs
├── Home.md              # → example.com/wiki/Home/
└── Notes/
    └── ideas.md         # → example.com/wiki/Notes/ideas/
```

### Special Directories

| Directory | Purpose |
|-----------|---------|
| `_private/` | Never built, regardless of frontmatter. Configurable via `ignored_folders` in config. |
| `_homepage/` | Content deployed to site root (`/`) instead of `/wiki/` (or other prefix). Excluded from normal wiki generation. |

## Visibility System

Control what gets built and listed:

```yaml
---
public: true       # Built and accessible via direct link
published: true    # Also appears in listings and search
---
```

- No frontmatter or `public: false` → Not built (private)
- `public: true` → Built, accessible via URL
- `public: true, published: true` → Built AND visible in listings

## Configuration

`.foliate/config.toml`:

```toml
[site]
name = "My Wiki"
url = "https://example.com"

[build]
ignored_folders = ["_private", "drafts"]
wiki_prefix = "wiki"  # URL prefix for wiki content (set to "" for root)

[nav]
items = [
    { url = "/about/", label = "About" },
    { url = "/wiki/Home/", label = "Wiki" },
]
```

## Commands

```bash
foliate init      # Create .foliate/config.toml
foliate build     # Build site
foliate watch     # Build + serve + auto-rebuild
foliate clean     # Remove build artifacts
```

### Options

```bash
foliate build --force     # Force full rebuild
foliate build --verbose   # Detailed output
foliate build --serve     # Start server after build
foliate watch --port 3000 # Custom port
```

## Deployment

Foliate generates static files in `.foliate/build/`. Deploy anywhere that serves static files:

### rsync (VPS/Server)
```bash
rsync -avz --delete .foliate/build/ user@server:/var/www/mysite/
```

### GitHub Pages

**Separate repo** - e.g., push to a dedicated `username.github.io` repo:

```bash
# Clone your GitHub Pages repo alongside your vault
git clone git@github.com:username/username.github.io.git ../username.github.io

# Copy build output and push
cp -r .foliate/build/* ../username.github.io/
cd ../username.github.io && git add . && git commit -m "Deploy" && git push
```

**Same repo** - If your vault is the GitHub Pages repo:

```bash
# Option 1: Use docs/ folder (configure GitHub Pages to serve from docs/)
cp -r .foliate/build/* docs/

# Option 2: Use gh-pages branch (requires Node.js)
npx gh-pages -d .foliate/build
```

### Simple local copy
```bash
cp -r .foliate/build/* /path/to/webserver/
```

## License

MIT
