Skip to content

Commit 821e8be

Browse files
committed
Update files guide overview
1 parent 6386c86 commit 821e8be

File tree

1 file changed

+35
-17
lines changed
  • content/docs/1_guide/5_files/1_files

1 file changed

+35
-17
lines changed

content/docs/1_guide/5_files/1_files/guide.txt

+35-17
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,31 @@
1-
Title: Files
1+
Title: Overview
22

33
----
44

55
Description: Every page in your Kirby installation has its own set of files. Learn how Kirby handles these and how to add meta data to files.
66

77
----
88

9-
Intro: Pages can have any number and kind of images, videos, documents or other files. Those files are stored directly in the page's folder.
9+
Intro: Pages and the site object can have any number and kind of images, videos, documents or other files.
1010

1111
----
1212
Text:
1313

1414
For file handling via the Panel, see (link: docs/guide/files/files-in-the-panel text: Files in the Panel).
1515

16-
## Example page with files
16+
<info>
17+
This guide is about files that are stored within the `/content` folder only. Files outside of the content folder can also be used, but need to be handled as (link: docs/reference/objects/panel/assets text: `Assets`).
18+
</info>
19+
20+
## Where are files stored?
21+
22+
Files can belong either to
23+
24+
- the `Site` object: in this case, they are stored directly in the `/content` folder next to the `site.txt` file.
25+
- a `Page` object: in this case, they are stored inside a page folder within `/content`.
26+
27+
28+
### Folder structure for a page with files
1729

1830
```filesystem
1931
/content/projects/project-a/
@@ -25,18 +37,28 @@ For file handling via the Panel, see (link: docs/guide/files/files-in-the-panel
2537
/content/projects/project-a/project-data.xls
2638
/content/projects/project-a/some-video.mp4
2739
```
40+
### Folder structure for site files
41+
42+
```filesystem
43+
/content/image-1.jpg
44+
/content/image-2.jpg
45+
/content/image-3.jpg
46+
/content/document-1.pdf
47+
/content/data.xls
48+
/content/some-video.mp4
49+
```
2850

2951
## Supported file types
3052

31-
You can access the page's files using handy methods for each common file type:
53+
You can access files using handy methods for each common file type:
3254

33-
| Type | Extensions | API Method |
34-
| ---- | ---------- | ---------- |
35-
| Audio | aif, aiff, m4a, midi, mp3, wav | `$page->audio()` |
36-
| Code | css, js, json, java, htm, html, php, rb, py, scss, xml, yaml, yml | `$page->code()` |
37-
| Documents | csv, doc, docx, dotx, indd, md, mdown, pdf, ppt, pptx, rtf, txt, xl, xls, xlsx, xltx | `$page->documents()` |
38-
| Images | ai, avif, bmp, gif, eps, ico, j2k, jp2, jpeg, jpg, jpe, png, ps, psd, svg, tif, tiff, webp | `$page->images()` |
39-
| Videos | avi, flv, m4v, mov, movie, mpe, mpg, mp4, ogg, ogv, swf, webm | `$page->videos()` |
55+
| Type | Extensions | API Method |
56+
| ---- | ---------- |----------------------------------|
57+
| Audio | aif, aiff, m4a, midi, mp3, wav | `$page->audio()`/`$site->audio()`|
58+
| Code | css, js, json, java, htm, html, php, rb, py, scss, xml, yaml, yml | `$page->code()`/`$site->code()`|
59+
| Documents | csv, doc, docx, dotx, indd, md, mdown, pdf, ppt, pptx, rtf, txt, xl, xls, xlsx, xltx | `$page->documents()`/`$site->documents()`|
60+
| Images | ai, avif, bmp, gif, eps, ico, j2k, jp2, jpeg, jpg, jpe, png, ps, psd, svg, tif, tiff, webp | `$page->images()`/`$site->images()` |
61+
| Videos | avi, flv, m4v, mov, movie, mpe, mpg, mp4, ogg, ogv, swf, webm | `$page->videos()`/`$site->videos()` |
4062

4163
Other file types are of course also supported.
4264

@@ -46,16 +68,12 @@ To upload file types not supported out of the box by Kirby, you can (link: docs/
4668
When you are using `.txt` files for your content (as it is the default), you cannot upload other `.txt` files as they will be mistaken for content files. You can configure this via the (link: docs/reference/system/options/content#content-file-extension text: `content.extension` config option).
4769
</info>
4870

49-
## Site files
50-
51-
Files cannot only be uploaded to a page, but also to the site object, i.e. directly into the `/content` folder. To upload images to the site object in the Panel, you have to create a files section in the `site.yml` blueprint.
5271

5372
## Manually uploading files
5473

55-
You can add/upload files to a page manually by placing it into the corresponding page folder.
56-
57-
Note that if you upload files to a page and want to use them later in the Panel, you have to define files sections in your blueprints. Otherwise, these files will not show up.
74+
You can add/upload files to a page/the site manually by placing them into the corresponding folders.
5875

76+
Note that if you upload files you later want to use in the Panel, you have to define (link: docs/reference/panel/sections/files text: files sections) in your blueprints. Otherwise, these files will not show up.
5977

6078
## Linking to files in your content
6179

0 commit comments

Comments
 (0)