2025-11-27 23:01:02 +01:00
# Adding Content
2026-02-07 19:14:13 +01:00
FolderWeb turns your folder structure into a website. Every file becomes a page, every folder becomes a URL path.
2025-11-27 23:01:02 +01:00
## The Basic Idea
```
content/
├── about.md → yoursite.com/about/
├── blog/
│ └── index.md → yoursite.com/blog/
└── contact.html → yoursite.com/contact/
```
2026-02-07 19:14:13 +01:00
No configuration required.
2025-11-27 23:01:02 +01:00
2026-02-07 19:14:13 +01:00
## Content Formats
2025-11-27 23:01:02 +01:00
2026-02-07 19:14:13 +01:00
FolderWeb supports three content formats. You can use them individually or mix them within a single page.
2025-11-27 23:01:02 +01:00
### Markdown (`.md`)
```markdown
# My Page Title
This is a paragraph with **bold** and *italic* text.
- Lists work
- And so do [links ](https://example.com )
```
2026-02-07 19:14:13 +01:00
Converted to HTML using [Parsedown ](https://parsedown.org/ ) with caching.
2025-11-27 23:01:02 +01:00
### HTML (`.html`)
```html
< h1 > My Page< / h1 >
2026-02-07 19:14:13 +01:00
< p > Plain HTML, rendered as-is.< / p >
2025-11-27 23:01:02 +01:00
< div class = "custom-widget" >
2026-02-07 19:14:13 +01:00
Full control over markup.
2025-11-27 23:01:02 +01:00
< / div >
```
### PHP (`.php`)
```php
< ?php
$currentYear = date('Y');
echo "< p > Copyright {$currentYear}< / p > ";
?>
```
2026-02-07 19:14:13 +01:00
PHP files are executed server-side. Be careful with user input and security.
2025-11-27 23:01:02 +01:00
## Folder Structure as URL Structure
Your folder hierarchy determines your URLs:
```
content/
├── index.md → /
├── about.md → /about/
├── blog/
│ ├── index.md → /blog/
│ ├── 2024-12-15-first-post/
│ │ └── index.md → /blog/first-post/
│ └── 2024-12-20-second-post/
│ └── index.md → /blog/second-post/
└── projects/
├── index.md → /projects/
└── my-project/
└── index.md → /projects/my-project/
```
- Folder names become URL slugs
- Date prefixes (`YYYY-MM-DD-` ) are stripped from URLs but preserved for sorting
2026-02-07 19:14:13 +01:00
- Trailing slashes are enforced (`/about` redirects to `/about/` )
2025-11-27 23:01:02 +01:00
## Multiple Files in One Page
2026-02-07 19:14:13 +01:00
Multiple content files in one directory render as a single page, combined in filename order.
2026-02-07 18:59:41 +01:00
**Prefix filenames with numbers to control the order:**
2025-11-27 23:01:02 +01:00
```
content/portfolio/
2026-02-07 18:59:41 +01:00
├── 10-hero.php # Renders first — dynamic PHP banner
├── 20-intro.md # Renders second — Markdown prose
├── 30-gallery.html # Renders third — HTML layout
└── 40-contact.md # Renders last — Markdown form
2025-11-27 23:01:02 +01:00
```
2026-02-07 18:59:41 +01:00
All four files render as one page at `/portfolio/` . You can mix `.md` , `.html` , and `.php` freely — use whichever format fits each section best.
2025-11-27 23:01:02 +01:00
2026-02-07 19:14:13 +01:00
**Why number prefixes?** Files are sorted using natural sort, so `10-` comes before `20-` comes before `30-` . Using increments of 10 leaves room to insert new sections later without renaming existing files. Files without a number prefix sort after numbered files.
2025-11-27 23:01:02 +01:00
## Dates in Folder Names
2026-02-07 19:14:13 +01:00
FolderWeb extracts dates from folder names automatically:
2025-11-27 23:01:02 +01:00
```
content/blog/
├── 2024-12-15-my-first-post/ # Date: December 15, 2024
├── 2024-12-20-another-post/ # Date: December 20, 2024
└── 2025-01-01-new-year-post/ # Date: January 1, 2025
```
2026-02-07 19:14:13 +01:00
The `YYYY-MM-DD-` prefix is stripped from the URL:
2025-11-27 23:01:02 +01:00
- Folder: `2024-12-15-my-first-post`
- URL: `/blog/my-first-post/`
2026-02-07 19:14:13 +01:00
Dates are formatted based on your configured language.
2025-11-27 23:01:02 +01:00
2026-02-07 19:14:13 +01:00
## Assets
2025-11-27 23:01:02 +01:00
2026-02-07 19:14:13 +01:00
Drop images and other files directly in your content folders:
2025-11-27 23:01:02 +01:00
```
content/blog/my-post/
├── index.md
├── cover.jpg # Cover image (automatic)
├── diagram.png # Referenced in content
└── styles.css # Page-specific styles
```
2026-02-07 19:14:13 +01:00
Reference in Markdown:
2025-11-27 23:01:02 +01:00
```markdown

```
2026-02-07 19:14:13 +01:00
**Cover images:** Name your image `cover.jpg` , `cover.png` , or `cover.webp` . FolderWeb uses it automatically in list views and social media meta tags.
2025-11-27 23:01:02 +01:00
2026-02-07 19:14:13 +01:00
## Metadata
2025-11-27 23:01:02 +01:00
2026-02-07 19:14:13 +01:00
Add a `metadata.ini` file to configure a page:
2025-11-27 23:01:02 +01:00
```
content/blog/my-post/
├── index.md
└── metadata.ini
```
2026-02-07 19:14:13 +01:00
Basic metadata:
2025-11-27 23:01:02 +01:00
```ini
title = "My Awesome Post"
summary = "A short description for list views"
date = "2024-12-15"
```
2026-02-07 19:14:13 +01:00
More options:
2025-11-27 23:01:02 +01:00
```ini
title = "My Post"
summary = "Short description"
date = "2024-12-15"
2026-02-07 19:14:13 +01:00
search_description = "SEO description for search engines"
2025-11-27 23:01:02 +01:00
menu = 1 # Show in navigation menu
menu_order = 10 # Menu position (lower = first)
[settings]
show_date = true # Display date on page
2026-02-07 19:14:13 +01:00
hide_list = false # Force page view even with subdirectories
2025-11-27 23:01:02 +01:00
```
2026-02-07 19:14:13 +01:00
See the [Metadata Reference ](../03-reference/02-metadata.md ) for all options.
2025-11-27 23:01:02 +01:00
## List Views vs. Page Views
FolderWeb automatically decides whether to show a **list** or a **page** :
2026-02-07 19:14:13 +01:00
**List view** — directory has subdirectories:
2025-11-27 23:01:02 +01:00
```
content/blog/
2026-02-07 19:14:13 +01:00
├── index.md # Intro content (shown above list)
├── metadata.ini
2025-11-27 23:01:02 +01:00
├── 2024-12-15-first-post/
└── 2024-12-20-second-post/
```
2026-02-07 19:14:13 +01:00
Result: `/blog/` shows a list of posts.
2025-11-27 23:01:02 +01:00
2026-02-07 19:14:13 +01:00
**Page view** — directory has only files:
2025-11-27 23:01:02 +01:00
```
content/about/
└── index.md
```
2026-02-07 19:14:13 +01:00
Result: `/about/` shows the page content.
2025-11-27 23:01:02 +01:00
2026-02-07 19:14:13 +01:00
Set `hide_list = true` in `metadata.ini` to force page view even when subdirectories exist.
2025-11-27 23:01:02 +01:00
## Custom URL Slugs
2026-02-07 19:14:13 +01:00
Override the folder name as URL with metadata:
2025-11-27 23:01:02 +01:00
```ini
slug = "short-title"
```
2026-02-07 19:14:13 +01:00
Folder `2024-12-15-very-long-title/` becomes `/blog/short-title/` instead of `/blog/very-long-title/` .
2025-11-27 23:01:02 +01:00
2026-02-07 19:14:13 +01:00
## Navigation Menu
2025-11-27 23:01:02 +01:00
2026-02-07 19:14:13 +01:00
Add pages to the navigation menu:
2025-11-27 23:01:02 +01:00
```ini
title = "About Us"
menu = 1 # Show in menu
2026-02-07 19:14:13 +01:00
menu_order = 20 # Position (lower = first)
2025-11-27 23:01:02 +01:00
```
2026-02-07 19:14:13 +01:00
Items are sorted by `menu_order` , then alphabetically by title.
2025-11-27 23:01:02 +01:00
2026-02-07 19:14:13 +01:00
## Examples
2025-11-27 23:01:02 +01:00
2026-02-07 19:14:13 +01:00
### Blog Post
2025-11-27 23:01:02 +01:00
```
content/blog/2024-12-15-my-first-post/
├── index.md
├── cover.jpg
└── metadata.ini
```
**index.md:**
```markdown
# My First Post
2026-02-07 19:14:13 +01:00
Blog post content goes here.
2025-11-27 23:01:02 +01:00

```
**metadata.ini:**
```ini
title = "My First Post"
summary = "An introduction to my blog"
```
2026-02-07 19:14:13 +01:00
### Multi-Format Page
2025-11-27 23:01:02 +01:00
```
content/services/
2026-02-07 18:59:41 +01:00
├── 10-hero.php
├── 20-intro.md
├── 30-pricing.html
2025-11-27 23:01:02 +01:00
└── metadata.ini
```
2026-02-07 18:59:41 +01:00
All content files render together as one page at `/services/` , in number-prefix order.
2025-11-27 23:01:02 +01:00
2026-02-07 19:14:13 +01:00
## Next Steps
2025-11-27 23:01:02 +01:00
2026-02-07 19:14:13 +01:00
- [Styling ](02-styling.md ) — Customize colors, fonts, and layout
- [Templates ](03-templates.md ) — Control how content is presented
- [Internationalization ](../03-reference/04-internationalization.md ) — Multi-language support