You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: content/docs/1_guide/5_files/1_files/guide.txt
+35-17
Original file line number
Diff line number
Diff line change
@@ -1,19 +1,31 @@
1
-
Title: Files
1
+
Title: Overview
2
2
3
3
----
4
4
5
5
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.
6
6
7
7
----
8
8
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.
10
10
11
11
----
12
12
Text:
13
13
14
14
For file handling via the Panel, see (link: docs/guide/files/files-in-the-panel text: Files in the Panel).
15
15
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
17
29
18
30
```filesystem
19
31
/content/projects/project-a/
@@ -25,18 +37,28 @@ For file handling via the Panel, see (link: docs/guide/files/files-in-the-panel
25
37
/content/projects/project-a/project-data.xls
26
38
/content/projects/project-a/some-video.mp4
27
39
```
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
+
```
28
50
29
51
## Supported file types
30
52
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:
@@ -46,16 +68,12 @@ To upload file types not supported out of the box by Kirby, you can (link: docs/
46
68
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).
47
69
</info>
48
70
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.
52
71
53
72
## Manually uploading files
54
73
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.
58
75
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.
0 commit comments