Directory structure
What each directory of a fugo project holds, and how themes and mounts combine them.
A fugo project looks like this:
my-site/
├── config.toml the configuration, one file (or config.yaml, config.yml, config.json)
├── content/ Markdown and HTML content
├── layouts/ Tera templates
├── assets/ files processed by asset pipelines (Sass, JavaScript, images)
├── static/ files copied to the site as they are
├── data/ data files: JSON, TOML, YAML, CSV, XML
├── i18n/ translation tables
├── themes/ themes, each a project of its own
└── public/ the built site (created by fugo)Only config.toml and the content are required to start. A directory that does not exist is simply empty.
config.toml,config.yaml,config.yml,config.json- The configuration, one file: several are an error. Other file names are not read: rename a configuration file named after another generator to
config.toml. Every setting is in it, each environment’s in its[environments.<name>]table: fugo does not read a configuration directory (config/_default/), and stops with an error at one (see No configuration directory). content/- The pages of the site. The directory tree becomes the URL tree:
content/posts/hello.mdis published at/posts/hello/. See Content organization. layouts/- Templates, named after what they render:
baseof.html,home.html,single.html,list.html, plus_partials/,_shortcodes/and_markup/(render hooks). assets/- Files that templates read with
get_assetand process: Sass, JavaScript, images. Only the files a template publishes end up in the site. See Asset pipelines. static/- Files copied to the root of the site unchanged:
static/favicon.icobecomes/favicon.ico. data/- Data files available in templates as
site.data:data/authors.tomlissite.data.authors. i18n/- Translation tables for
i18n(key=…). themes/- Themes. A theme has the same structure as a project; the project’s files win over the theme’s.
public/- Where
fugowrites the site. Change it with-dorpublishDir. package.json,npm.lock,node_modules/- The npm packages the site uses. fugo installs them into
node_moduleswhen it builds, and records their versions innpm.lock. Commitpackage.jsonandnpm.lock, but notnode_modules.
Mounts#
Each directory above is a component. Module mounts map any directory of the project, or a theme, to a component: mount node_modules/bootstrap/scss into assets/bootstrap, or a shared image directory into static/images. This documentation mounts the repository’s brand/ directory into assets/brand to use the fugo logo.