folderweb/README.md

3.1 KiB

FolderWeb

A PHP router that turns folders into websites — and a core you can build upon. Drop files in a directory, and they become pages. No database, no build process.

How It Works

Your file system is your site structure. Create folders, drop in content files, and they're live.

content/about/intro.md  →  yoursite.com/about/

No routing configuration. No frontmatter. No build step. Save a file, refresh the browser.

Since everything is just files and folders, you can mount your site via SFTP or WebDAV and edit content directly from your local machine — save a file, and the change is live.

Mix Formats Freely

A single page can combine Markdown, HTML, and PHP. Use each format where it fits best — Markdown for prose, HTML for layout, PHP for dynamic output. Number prefixes control the order:

content/services/
├── 10-intro.md          # Markdown prose
├── 20-features.html     # Structured HTML section
└── 30-pricing.php       # Dynamic server-side output

All three render as one page at /services/.

Automatic Content Types

FolderWeb detects what kind of page to render based on your folder structure:

content/about/           # Only files → renders as a page
content/blog/            # Has subdirectories → renders as a list

Date prefixes in folder names are extracted automatically and stripped from URLs:

content/blog/2025-03-15-my-post/  →  /blog/my-post/  (date: March 15, 2025)

Cover images (cover.jpg), metadata (metadata.ini), and navigation are all convention-based. Almost nothing needs explicit configuration.

Customize Without Touching the Core

The custom/ directory overrides app/default/ for everything — templates, styles, config, languages, and plugins:

custom/
├── templates/    # Override any template
├── styles/       # Your CSS
├── plugins/      # Your plugins
├── languages/    # Translation overrides
└── config.ini    # Configuration overrides

To update FolderWeb, pull the latest app/. Your customizations stay untouched.

What You Need

  • PHP 8.4+
  • Apache with mod_rewrite

That's all. One dependency (Parsedown for Markdown). ~1,000 lines of core code.

Example Structure

project/
├── app/                    # Core (never modify)
├── content/                # Your content
│   ├── front.md
│   ├── about/
│   │   └── about.md
│   ├── portfolio/
│   │   ├── 10-intro.md
│   │   ├── 20-gallery.html
│   │   └── 30-stats.php
│   └── blog/
│       ├── metadata.ini
│       ├── 2025-11-01-first-post/
│       │   ├── first-post.md
│       │   ├── cover.jpg
│       │   └── metadata.ini
│       └── 2025-11-02-second-post/
│           └── post.md
└── custom/                 # Your customizations
    ├── templates/
    ├── styles/
    └── config.ini

Documentation

Complete documentation in docs/.

Start with the Getting Started guide or browse the tutorial.