Create a simple hero section with title, subtitle, and call-to-action
button Add a features section with icons and descriptions Include a stats section with live data Add a responsive design with modern CSS features
This commit is contained in:
parent
f0d50ff8bf
commit
0e19040473
101 changed files with 1356 additions and 7532 deletions
52
app/default/content/examples/file-based-routing/index.md
Normal file
52
app/default/content/examples/file-based-routing/index.md
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
# File-Based Routing
|
||||
|
||||
FolderWeb's routing is beautifully simple: **your folder structure is your URL structure**. No configuration files, no route definitions, no magic strings.
|
||||
|
||||
## How It Works
|
||||
|
||||
When you visit a URL, FolderWeb looks for matching folders and files:
|
||||
|
||||
```
|
||||
/content/
|
||||
├── index.md → /
|
||||
├── about/
|
||||
│ └── index.md → /about/
|
||||
└── blog/
|
||||
├── 2024-11-01-post/
|
||||
│ └── index.md → /blog/post/
|
||||
└── index.md → /blog/
|
||||
```
|
||||
|
||||
## Automatic Features
|
||||
|
||||
**Folder names become URLs** – Create a folder called `projects` and it's instantly available at `/projects/`
|
||||
|
||||
**Date prefixes are stripped** – `2024-11-01-my-post` becomes `/my-post/` in the URL
|
||||
|
||||
**Custom slugs via metadata** – Override the default URL with `slug = "custom-url"` in `metadata.ini`
|
||||
|
||||
**Trailing slashes** – Directories always redirect to include trailing slashes for consistency
|
||||
|
||||
## Example
|
||||
|
||||
This very page demonstrates file-based routing! The path is:
|
||||
|
||||
```
|
||||
app/default/content/examples/file-based-routing/index.md
|
||||
```
|
||||
|
||||
Which renders at:
|
||||
|
||||
```
|
||||
/examples/file-based-routing/
|
||||
```
|
||||
|
||||
No routes to define. No configuration to update. Just files and folders.
|
||||
|
||||
## Benefits
|
||||
|
||||
- **Intuitive** – If you can navigate folders, you understand the routing
|
||||
- **Refactor-friendly** – Moving content means moving folders
|
||||
- **No broken links** – URLs match the filesystem
|
||||
- **Fast** – No route matching overhead, direct file lookup
|
||||
- **Predictable** – What you see is what you get
|
||||
52
app/default/content/examples/file-based-routing/index.no.md
Normal file
52
app/default/content/examples/file-based-routing/index.no.md
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
# Filbasert routing
|
||||
|
||||
FolderWebs routing er vakkert enkelt: **mappestrukturen din er URL-strukturen din**. Ingen konfigurasjonsfiler, ingen rutedefinisjon, ingen magiske strenger.
|
||||
|
||||
## Hvordan det fungerer
|
||||
|
||||
Når du besøker en URL, ser FolderWeb etter matchende mapper og filer:
|
||||
|
||||
```
|
||||
/content/
|
||||
├── index.md → /
|
||||
├── om/
|
||||
│ └── index.md → /om/
|
||||
└── blogg/
|
||||
├── 2024-11-01-innlegg/
|
||||
│ └── index.md → /blogg/innlegg/
|
||||
└── index.md → /blogg/
|
||||
```
|
||||
|
||||
## Automatiske funksjoner
|
||||
|
||||
**Mappenavn blir URL-er** – Lag en mappe kalt `prosjekter` og den er umiddelbart tilgjengelig på `/prosjekter/`
|
||||
|
||||
**Datoprefikser fjernes** – `2024-11-01-mitt-innlegg` blir `/mitt-innlegg/` i URL-en
|
||||
|
||||
**Egendefinerte slugs via metadata** – Overstyr standard URL med `slug = "egendefinert-url"` i `metadata.ini`
|
||||
|
||||
**Avsluttende skråstrek** – Kataloger omdirigerer alltid til å inkludere avsluttende skråstrek for konsistens
|
||||
|
||||
## Eksempel
|
||||
|
||||
Denne siden demonstrerer filbasert routing! Stien er:
|
||||
|
||||
```
|
||||
app/default/content/examples/file-based-routing/index.no.md
|
||||
```
|
||||
|
||||
Som rendres på:
|
||||
|
||||
```
|
||||
/examples/file-based-routing/
|
||||
```
|
||||
|
||||
Ingen ruter å definere. Ingen konfigurasjon å oppdatere. Bare filer og mapper.
|
||||
|
||||
## Fordeler
|
||||
|
||||
- **Intuitivt** – Hvis du kan navigere mapper, forstår du routingen
|
||||
- **Refaktorvennlig** – Å flytte innhold betyr å flytte mapper
|
||||
- **Ingen ødelagte lenker** – URL-er matcher filsystemet
|
||||
- **Rask** – Ingen rutematching overhead, direkte filoppslag
|
||||
- **Forutsigbar** – Det du ser er det du får
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
title = "File-Based Routing"
|
||||
summary = "Your folder structure is your URL structure—no configuration needed"
|
||||
date = "2024-11-26"
|
||||
Loading…
Add table
Add a link
Reference in a new issue