diff --git a/content/en/content-management/static-files.md b/content/en/content-management/static-files.md deleted file mode 100644 index c1197ede1..000000000 --- a/content/en/content-management/static-files.md +++ /dev/null @@ -1,68 +0,0 @@ ---- -title: Static files -description: Files that get served **statically** (as-is, no modification) on the site root. -categories: [content management] -keywords: [source, directories] -menu: - docs: - parent: content-management - weight: 200 -weight: 200 -toc: true -aliases: [/static-files] ---- - -By default, the `static/` directory in the site project is used for -all **static files** (e.g. stylesheets, JavaScript, images). The static files are served on the site root path (eg. if you have the file `static/image.png` you can access it using `http://{server-url}/image.png`, to include it in a document you can use `![Example image](/image.png) )`. - -Hugo can be configured to look into a different directory, or even -**multiple directories** for such static files by configuring the -`staticDir` parameter in the [site configuration]. All the files in all the -static directories will form a union filesystem. - -This union filesystem will be served from your site root. So a file -`/static/me.png` will be accessible as -`/me.png`. - -Here's an example of setting `staticDir` and `staticDir2` for a -multi-language site: - -{{< code-toggle file=hugo >}} -staticDir = ["static1", "static2"] - -[languages] -[languages.en] -staticDir2 = "static_en" -baseURL = "https://example.org/" -languageName = "English" -weight = 2 -title = "In English" -[languages.no] -staticDir = ["staticDir_override", "static_no"] -baseURL = "https://example.no" -languageName = "Norsk" -weight = 1 -title = "På norsk" -{{}} - -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 1 -: The **2** (can be a number between 0 and 10) in `staticDir2` is - added to tell Hugo that you want to **add** this directory to the - global set of static directories defined using `staticDir`. Using - `staticDir` on the language level would replace the global value (as - can be seen in the Norwegian site case). - -Note 2 -: The example above is a [multihost setup]. In a regular setup, all - the static directories will be available to all sites. - -[site configuration]: /getting-started/configuration/#all-configuration-settings -[multihost setup]: /content-management/multilingual/#configure-multilingual-multihost diff --git a/content/en/getting-started/directory-structure.md b/content/en/getting-started/directory-structure.md index da2dde6b2..2331d8838 100644 --- a/content/en/getting-started/directory-structure.md +++ b/content/en/getting-started/directory-structure.md @@ -78,38 +78,49 @@ my-site/ Each of the subdirectories contributes to the content, structure, behavior, or presentation of your site. -archetypes -: The `archetypes` directory contains templates for new content. See [details](/content-management/archetypes/). +###### archetypes -assets -: The `assets` directory contains global resources typically passed through an asset pipeline. This includes resources such as images, CSS, Sass, JavaScript, and TypeScript. See [details](/hugo-pipes/introduction/). +The `archetypes` directory contains templates for new content. See [details](/content-management/archetypes/). -config -: The `config` directory contains your site configuration, possibly split into multiple subdirectories and files. For projects with minimal configuration or projects that do not need to behave differently in different environments, a single configuration file named `hugo.toml` in the root of the project is sufficient. See [details](/getting-started/configuration/#configuration-directory). +###### assets -content -: The `content` directory contains the markup files (typically Markdown) and page resources that comprise the content of your site. See [details](/content-management/organization/). +The `assets` directory contains global resources typically passed through an asset pipeline. This includes resources such as images, CSS, Sass, JavaScript, and TypeScript. See [details](/hugo-pipes/introduction/). -data -: The `data` directory contains data files (JSON, TOML, YAML, or XML) that augment content, configuration, localization, and navigation. See [details](/content-management/data-sources/). +###### config -i18n -: The `i18n` directory contains translation tables for multilingual sites. See [details](/content-management/multilingual/). +The `config` directory contains your site configuration, possibly split into multiple subdirectories and files. For projects with minimal configuration or projects that do not need to behave differently in different environments, a single configuration file named `hugo.toml` in the root of the project is sufficient. See [details](/getting-started/configuration/#configuration-directory). -layouts -: The layouts directory contains templates to transform content, data, and resources into a complete website. See [details](/templates/). +###### content -public -: The `public` directory contains the published website, generated when you run the `hugo` or `hugo server` commands. Hugo recreates this directory and its content as needed. See [details](/getting-started/usage/#build-your-site). +The `content` directory contains the markup files (typically Markdown) and page resources that comprise the content of your site. See [details](/content-management/organization/). -resources -: The `resources` directory contains cached output from Hugo's asset pipelines, generated when you run the `hugo` or `hugo server` commands. By default this cache directory includes CSS and images. Hugo recreates this directory and its content as needed. +###### data -static -: The `static` directory contains files that will be copied to the public directory when you build your site. For example: `favicon.ico`, `robots.txt`, and files that verify site ownership. Before the introduction of [page bundles](/getting-started/glossary/#page-bundle) and [asset pipelines](/hugo-pipes/introduction/), the `static` directory was also used for images, CSS, and JavaScript. See [details](/content-management/static-files/). +The `data` directory contains data files (JSON, TOML, YAML, or XML) that augment content, configuration, localization, and navigation. See [details](/content-management/data-sources/). -themes -: The `themes` directory contains one or more [themes](/getting-started/glossary/#theme), each in its own subdirectory. +###### i18n + +The `i18n` directory contains translation tables for multilingual sites. See [details](/content-management/multilingual/). + +###### layouts + +The layouts directory contains templates to transform content, data, and resources into a complete website. See [details](/templates/). + +###### public + +The `public` directory contains the published website, generated when you run the `hugo` or `hugo server` commands. Hugo recreates this directory and its content as needed. See [details](/getting-started/usage/#build-your-site). + +###### resources + +The `resources` directory contains cached output from Hugo's asset pipelines, generated when you run the `hugo` or `hugo server` commands. By default this cache directory includes CSS and images. Hugo recreates this directory and its content as needed. + +###### static + +The `static` directory contains files that will be copied to the public directory when you build your site. For example: `favicon.ico`, `robots.txt`, and files that verify site ownership. Before the introduction of [page bundles](/getting-started/glossary/#page-bundle) and [asset pipelines](/hugo-pipes/introduction/), the `static` directory was also used for images, CSS, and JavaScript. + +###### themes + +The `themes` directory contains one or more [themes](/getting-started/glossary/#theme), each in its own subdirectory. ## Union file system