Update README with clearer structure and features
This commit is contained in:
parent
ad516600bb
commit
6647d0c964
1 changed files with 33 additions and 90 deletions
123
README.md
123
README.md
|
|
@ -1,105 +1,48 @@
|
||||||
# FolderWeb
|
# FolderWeb
|
||||||
|
|
||||||
A minimal, file-based PHP framework for publishing content that will work for decades. **Just enough, nothing more.** FolderWeb applies minimal PHP to enable modern conveniences while remaining maintainable for years or decades. No frameworks, no build tools, no JavaScript—just HTML, PHP 8.4+, and CSS. This is not a CMS with an admin panel, not a single-page application.
|
**Just enough, nothing more.** Drop Markdown files in folders, and they become pages. No database, no build process.
|
||||||
|
|
||||||
## Getting Started
|
## What is FolderWeb?
|
||||||
|
|
||||||
### Requirements
|
FolderWeb is a content publishing framework where your file system is your content management system. Create a folder structure that mirrors your site hierarchy, drop files into folders, and they immediately become pages.
|
||||||
|
|
||||||
- **PHP 8.4 or higher** (uses property hooks, readonly classes, and modern array functions)
|
**Core principle**: Simplicity and longevity over features and complexity.
|
||||||
- A web server (Apache, Nginx, or PHP's built-in server)
|
|
||||||
|
|
||||||
### Quick Start
|
## Key Features
|
||||||
|
|
||||||
1. Clone or download this repository
|
- **File-based routing**: `content/blog/post/` → `yoursite.com/blog/post/`
|
||||||
2. Point your web server's document root to /content
|
- **Multi-language support**: Built-in i18n with URL prefixes
|
||||||
|
- **Template system**: Override defaults with custom templates
|
||||||
|
- **Modern CSS**: CSS variables, nesting, OKLCH colors, grid layouts
|
||||||
|
- **No build process**: Save and refresh—see changes immediately
|
||||||
|
|
||||||
## Development
|
## Example Structure
|
||||||
|
|
||||||
### Creating Content
|
|
||||||
|
|
||||||
1. Create a directory for your content in the document root
|
|
||||||
2. Add one or more content files (`.md`, `.php`, or `.html`)
|
|
||||||
3. Optionally add `metadata.ini` for title, date, and summary
|
|
||||||
4. Optionally add `cover.jpg|webp` for list view thumbnails
|
|
||||||
|
|
||||||
Content is immediately accessible at the URL matching the directory path.
|
|
||||||
|
|
||||||
**Example structure:**
|
|
||||||
|
|
||||||
```
|
```
|
||||||
/content/
|
project/
|
||||||
00-welcome.php
|
├── app/ # App (never modify)
|
||||||
01-introduction.md
|
├── content/ # Your website content
|
||||||
about/
|
│ ├── front.md # Home page
|
||||||
00-overview.md
|
│ ├── about/ # About page
|
||||||
01-philosophy.html
|
│ │ └── about-me.md
|
||||||
02-technology.php
|
│ └── blog/ # Blog with list view
|
||||||
blog/
|
│ ├── metadata.ini # Configure template
|
||||||
2025-11-01-hello-world/
|
│ ├── 2025-11-01-first-post/
|
||||||
article.md
|
│ │ ├── first-post.md
|
||||||
cover.jpg
|
│ │ ├── cover.jpg
|
||||||
metadata.ini
|
│ │ └── metadata.ini
|
||||||
|
│ └── 2025-11-02-second-post/
|
||||||
|
│ └── another-post.md
|
||||||
|
└── custom/ # Your customizations
|
||||||
|
├── templates/ # Custom templates
|
||||||
|
├── styles/ # Custom CSS
|
||||||
|
└── config.ini # Configuration
|
||||||
```
|
```
|
||||||
|
|
||||||
### Multi-File Pages
|
## Documentation
|
||||||
|
|
||||||
Any folder without subdirectories is a **page-type folder**. All `.md`, `.html`, and `.php` files in that folder render together as a single page in **alphanumerical order**.
|
**Complete documentation available in [`docs/`](docs/)**
|
||||||
|
|
||||||
This allows you to:
|
## Learn More
|
||||||
|
|
||||||
- Break long content into manageable sections
|
Start with the **[Getting Started Tutorial](docs/tutorial/00-getting-started.md)** or browse the **[complete documentation](docs/)**.
|
||||||
- Mix file formats freely (Markdown, HTML, PHP)
|
|
||||||
- Reorder sections by renaming files
|
|
||||||
- Include dynamic PHP content alongside static content
|
|
||||||
|
|
||||||
**Example:**
|
|
||||||
|
|
||||||
```
|
|
||||||
/content/
|
|
||||||
docs/
|
|
||||||
00-introduction.md
|
|
||||||
01-setup.md
|
|
||||||
02-advanced.html
|
|
||||||
03-examples.php
|
|
||||||
```
|
|
||||||
|
|
||||||
All four files render as one page at `/docs/`, in that order.
|
|
||||||
|
|
||||||
### Folder Types
|
|
||||||
|
|
||||||
FolderWeb automatically determines how to render folders:
|
|
||||||
|
|
||||||
- **Page-type folder** (no subdirectories) → Renders all content files as a single page
|
|
||||||
- **Article-type folder** (has subdirectories) → Shows list view with links to subdirectories
|
|
||||||
|
|
||||||
### Customization
|
|
||||||
|
|
||||||
All customization lives in `custom/`:
|
|
||||||
|
|
||||||
- **Styles:** Place CSS in `custom/styles/base.css`
|
|
||||||
- **Templates:** Override defaults by placing files in `custom/templates/`
|
|
||||||
- **Fonts:** Add font files to `custom/fonts/`
|
|
||||||
- **Configuration:** Copy `app/config.ini` to `custom/config.ini` and modify
|
|
||||||
|
|
||||||
Never modify files in `/app/default/`—always override them in `custom/`.
|
|
||||||
|
|
||||||
### File-Based Routing
|
|
||||||
|
|
||||||
The folder hierarchy dictates URL structure:
|
|
||||||
|
|
||||||
- Root content files → `yoursite.com/`
|
|
||||||
- `/about/` (with content files) → `yoursite.com/about/`
|
|
||||||
- `/blog/2025-11-01-post/` (with content files) → `yoursite.com/blog/2025-11-01-post/`
|
|
||||||
- Dates in folder names are automatically extracted and formatted
|
|
||||||
- Content file names can be anything (not limited to `page.md` or `article.md`)
|
|
||||||
|
|
||||||
### Metadata
|
|
||||||
|
|
||||||
Use `metadata.ini` files for structured data:
|
|
||||||
|
|
||||||
```ini
|
|
||||||
title = "My Page Title"
|
|
||||||
date = "2025-11-01"
|
|
||||||
summary = "A brief description of the page"
|
|
||||||
```
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue