Add multi-file page support and improve documentation
Update README to explain multi-file page functionality Add example content files demonstrating the feature Improve folder type detection logic Implement new routing for page-type folders Add support for mixed content types in single pages Update navigation and metadata handling for multi-file pages Remove legacy frontpage.php in favor of multi-file approach Improve file-based routing documentation Add examples of different content types working together Update router to handle multi-file content rendering Implement proper sorting of content files Add best practices for multi-file content organization
This commit is contained in:
parent
f2c18659dc
commit
b507a0c676
20 changed files with 458 additions and 240 deletions
46
README.md
46
README.md
|
|
@ -19,7 +19,7 @@ A minimal, file-based PHP framework for publishing content that will work for de
|
|||
### Creating Content
|
||||
|
||||
1. Create a directory for your content in the document root
|
||||
2. Add a content file (.md, .php or .html)
|
||||
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
|
||||
|
||||
|
|
@ -29,8 +29,12 @@ Content is immediately accessible at the URL matching the directory path.
|
|||
|
||||
```
|
||||
/content/
|
||||
00-welcome.php
|
||||
01-introduction.md
|
||||
about/
|
||||
page.md
|
||||
00-overview.md
|
||||
01-philosophy.html
|
||||
02-technology.php
|
||||
blog/
|
||||
2025-11-01-hello-world/
|
||||
article.md
|
||||
|
|
@ -38,6 +42,37 @@ Content is immediately accessible at the URL matching the directory path.
|
|||
metadata.ini
|
||||
```
|
||||
|
||||
### Multi-File Pages
|
||||
|
||||
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**.
|
||||
|
||||
This allows you to:
|
||||
|
||||
- Break long content into manageable sections
|
||||
- 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/`:
|
||||
|
|
@ -53,10 +88,11 @@ Never modify files in `/app/default/`—always override them in `custom/`.
|
|||
|
||||
The folder hierarchy dictates URL structure:
|
||||
|
||||
- `/about/page.md` → `yoursite.com/about`
|
||||
- `/blog/2025-11-01-post/article.md` → `yoursite.com/blog/2025-11-01-post`
|
||||
- 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
|
||||
- Directories with subdirectories automatically show list views
|
||||
- Content file names can be anything (not limited to `page.md` or `article.md`)
|
||||
|
||||
### Metadata
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue