Allow hotlinking images

This commit is contained in:
2026-01-26 09:38:52 +01:00
parent 16e80f81c0
commit 7a4ce8609c
4 changed files with 68 additions and 33 deletions

View File

@@ -220,20 +220,29 @@ Clicking a thumbnail opens a lightbox viewer. Thumbnails are generated and cache
```
{{image>/Scape/photos/picture.jpg|This is the caption}}
{{image>/Scape/photos/picture.jpg?400|Resized to 400px width}}
{{image>/Scape/photos/picture.jpg?400x300|Fixed dimensions}}
{{image>/Scape/photos/picture.jpg?left|Float left}}
{{image>/Scape/photos/picture.jpg?400&center|Resized and centered}}
{{image>/Scape/photos/picture.jpg|Caption|400}}
{{image>/Scape/photos/picture.jpg|Caption|400x300}}
{{image>/Scape/photos/picture.jpg|Caption|left}}
{{image>/Scape/photos/picture.jpg|Caption|400&center}}
{{image>https://example.com/images/picture.jpg|Remote image caption}}
{{image>https://example.com/images/picture.jpg|Remote caption|400x300&left}}
```
Renders a Wikipedia-style image box with optional caption. Parameters after `?` are separated by `&`:
Renders a Wikipedia-style image box with optional caption. The syntax uses pipe-separated parts:
- Size: `?200` (width) or `?200x150` (width × height)
- Alignment: `?left`, `?right` (default), or `?center`
- Combined: `?400&left` or `?400x300&center`
- `{{image>path|caption}}` Image with caption (uses defaults)
- `{{image>path|caption|options}}` Image with caption and options
Options (in the third part, separated by `&`):
- Size: `200` (width) or `200x150` (width × height)
- Alignment: `left`, `right` (default), or `center`
- Combined: `400&left` or `400x300&center`
The image links to the full-size version when clicked.
Remote images (HTTP/HTTPS URLs) are linked directly without proxying or thumbnailing.
### 5) Open a local path/folder (best-effort)
```