-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add doc about the new static dir support
- Loading branch information
Showing
2 changed files
with
51 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,45 @@ | |||
--- | |||
title: Static Files | |||
description: "The `static` folder is where you place all your **static files**." | |||
date: 2017-11-18 | |||
categories: [content management] | |||
keywords: [source, directories] | |||
menu: | |||
docs: | |||
parent: "content-management" | |||
weight: 130 | |||
weight: 130 #rem | |||
aliases: [/static-files] | |||
toc: true | |||
--- | |||
|
|||
The `static` folder is where you place all your **static files**, e.g. stylesheets, JavaScript, images etc. | |||
|
|||
You can set the name of the static folder to use in your configuration file, for example `config.toml`. From **Hugo 0.31** you can configure as many static directories as you need. All the files in all the static directories will form a union filesystem. | |||
|
|||
Example: | |||
|
|||
```toml | |||
staticDir = ["static1", "static2"] | |||
[languages] | |||
[languages.no] | |||
staticDir = ["staticDir_override", "static_no"] | |||
baseURL = "https://example.no" | |||
languageName = "Norsk" | |||
weight = 1 | |||
title = "På norsk" | |||
|
|||
[languages.en] | |||
staticDir2 = "static_en" | |||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong. |
|||
baseURL = "https://example.com" | |||
languageName = "English" | |||
weight = 2 | |||
title = "In English" | |||
``` | |||
|
|||
In the above, with no theme used: | |||
|
|||
* The English site will get its static files as a union of "static1", "static2" and "static_en". On file duplicates, the right-most version will win. | |||
* The Norwegian site will get its static files as a union of "staticDir_override" and "static_no". | |||
|
|||
**Note:** The example above is a [multihost setup](/content-management/multilingual/#configure-multilingual-multihost). In a regular setup, all the static directories will be available to all sites. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Is that a typo? staticDir2 -> staticDir?