|
2 | 2 |
|
3 | 3 | BookStack allows visual customization via the theme system which enables you to extensively customize views, translation text & icons.
|
4 | 4 |
|
5 |
| -This theme system itself is maintained and supported but usages of this system, including the files you are able to override, are not considered stable and may change upon any update. You should test any customizations made after updates. |
| 5 | +This is part of the theme system alongside the [logical theme system](./logical-theme-system.md). |
| 6 | + |
| 7 | +**Note:** This theme system itself is maintained and supported but usages of this system, including the files you are able to override, are not considered stable and may change upon any update. You should test any customizations made after updates. |
6 | 8 |
|
7 | 9 | ## Getting Started
|
8 | 10 |
|
@@ -32,3 +34,24 @@ return [
|
32 | 34 | 'search' => 'find',
|
33 | 35 | ];
|
34 | 36 | ```
|
| 37 | + |
| 38 | +## Publicly Accessible Files |
| 39 | + |
| 40 | +As part of deeper customizations you may want to expose additional files |
| 41 | +(images, scripts, styles, etc...) as part of your theme, in a way so they're |
| 42 | +accessible in public web-space to browsers. |
| 43 | + |
| 44 | +To achieve this, you can put files within a `themes/<theme_name>/public` folder. |
| 45 | +BookStack will serve any files within this folder from a `/theme/<theme_name>` base path. |
| 46 | + |
| 47 | +As an example, if I had an image located at `themes/custom/public/cat.jpg`, I could access |
| 48 | +that image via the URL path `/theme/custom/cat.jpg`. That's assuming that `custom` is the currently |
| 49 | +configured application theme. |
| 50 | + |
| 51 | +There are some considerations to these publicly served files: |
| 52 | + |
| 53 | +- Only a predetermined range "web safe" content-types are currently served. |
| 54 | + - This limits running into potential insecure scenarios in serving problematic file types. |
| 55 | +- A static 1-day cache time it set on files served from this folder. |
| 56 | + - You can use alternative cache-breaking techniques (change of query string) upon changes if needed. |
| 57 | + - If required, you could likely override caching at the webserver level. |
0 commit comments