Update framework documentation and rename project to FolderWeb

This commit is contained in:
Ruben 2025-11-01 17:23:11 +01:00
parent 4c697122ab
commit f2c18659dc
3 changed files with 64 additions and 321 deletions

View file

@ -1,24 +1,69 @@
# PNP (Plug'n Play) - A 'just enough' PHP framework for simple websites
# FolderWeb
HTML lacks native support for including repeating elements, like the site header and footer. By using PHP sparsely, we can add this feature and some other modern conviniences, while providing a nearly maintanance-free framework that will chugh along for years, possibly decades, by avoiding a bunch of rapidly changing components and dependencies. Since reasonably up-to-date PHP versions is available at the vast majority of shared hosting providers, it makes sence to combine HTML with PHP.
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.3+, and CSS. This is not a CMS with an admin panel, not a single-page application.
The mission statement is to apply just enough PHP to make the core features work. No admin panel, just an intuitive folder-based workflow. Intuitive defaults are applied, with optional overrides and customizations.
## Getting Started
## Main features from the users perspective
### Requirements
- The user should be able to create a new folder and drop in a markdown, PHP or HTML file and have it rendered imediatly. The directory hierarchy dictate the URL, for example `/www/articles/2025/10-23-title-of-article/article.md` would translate to the following URL: `domain.tld/articles/2025/-10-23-title-of-article/`.
- The user can drop images and files in a directory and use them as assets. If a user drops a jpeg or webp into the folder mentioned above, the image can be refferenced in the markdown, like so: `[!alt text for the image](filname.jpg). The image will be renderend inline in the text. The same goes for PDF's or other document files, only they will not be rendered, but can be linked to.
- If a directory contains one or more subfolders, it is assumed that it is a parent folder containing multiple instances of the same type of content, for example a list of articles, blog posts and so on. A default list view will be applied showing title and date, but the view can be overriden and defined for each content type / folder.
- PHP 8.3 or higher
- A web server (Apache, Nginx, or PHP's built-in server)
## Main features from a developers perspective
### Quick Start
- The code is readable and adds nothing more than strictly neccessary
- Only HTML, PHP and CSS is allowed no JS!
- Sparsely commented, only the main sections
- Custom templates is located at /app/custom
- Third party scripts are added to /app/vendors
- Supports PHP 8.3+ and makes use of modern PHP features whenever possible
- Uses a PHP to make a simple router
- Uses .htaccess to make the PHP router handle all requests.
- The HTML is classles and highly compliant with best practices
- The CSS uses modern features to apply styles as effective and smart as possible
1. Clone or download this repository
2. Point your web server's document root to /content
## Development
### Creating Content
1. Create a directory for your content in the document root
2. Add a content file (.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/
about/
page.md
blog/
2025-11-01-hello-world/
article.md
cover.jpg
metadata.ini
```
### 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:
- `/about/page.md``yoursite.com/about`
- `/blog/2025-11-01-post/article.md``yoursite.com/blog/2025-11-01-post`
- Dates in folder names are automatically extracted and formatted
- Directories with subdirectories automatically show list views
### Metadata
Use `metadata.ini` files for structured data:
```ini
title = "My Page Title"
date = "2025-11-01"
summary = "A brief description of the page"
```