{ "title": "Docs", "date": "2026-07-22T08:54:00-04:00", "toc": true } ## Introduction This guide assumes you have either read [The Guide](../guide), or have built a [Hugo](https://gohugo.io) site before. It also assumes you have a basic knowledge of HTML and CSS. ## Features Thor has many features and content processors available. In an effort to provide the best out of the box experience, most of them are enabled by default. ### Opt-In Features TODO: #### deflist syntax TODO: #### footnotes #### Minify If enabled, `minify` will perform simple whitespace removal on all your output `.html` files, and any `.css` files in your `assets` directories. Minifying JavaScript is not supported (yet). TODO: Do we minify inline css? ### Opt-Out Features - emoji - sidenotes/marginnotes - syntax highlighting - heading ids - TODO: Table Of Contents Generation - [GitHub style alerts](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#alerts) ## Directories Like Hugo, a Thor project is a collection of specially named directories, plus an optional config file. All directories are optional, but it is recommended to at least have a `content` directory. content : `content` holds your pages and page bundles. See [Content](#content). If not found, thor will look for content files in the root of your current working directory. assets : `assets` contains any static files for your site (favicon.ico, etc.), as well as files you want to send through the asset pipeline (CSS or JS files). layouts : `layouts` holds your templates and partials. See [Templates](#templates). public : `public` will contain your completed site. All of these names can be remapped in `thor.json`.[^remap] [^remap]: While directories can be remapped at the site level, modules must (currently) adhere to the defaults. ### Assets Currently, there is only one asset processor, and that is [the minifier](#minify), though more are planned (i.e. Image processing). TODO: Expand ## Content ### Pages & Page Bundles Page content can either be defined in a single file (`contact.md`), or in a directory (`contact/index.md` + `contact/our-team.jpg`). Single file pages are preferred to page bundles.[^1] [^1]: That's not you say you shouldn't use bundles, but if you have no additional resources on your page, there's no benefit to using a bundle. Thor currently supports 2 formats for page files: MarkDown (`.md`), and HTML (`.html`). TODO: Content ### Frontmatter TODO: Frontmatter ## Menus TODO: Describe TODO: Don't forget to highlight differences from Hugo. ## Templates[^tempmod] [^tempmod]: Template modification is an "advanced" feature, and shoud probably be discussed later in the page. (or possibly in the guide.) Sites are built using one or more template files written in an extended version of [mustache](https://mustache.github.io) templates. The [mustache manual](https://mustache.github.io/mustache.5.html) has great explainations and a lot of examples if you want to know more, but I'll summarize them for you here. The beauty of Mustache is that there is very little syntax; there are just 10 symbols you need learn: `{{`, `{{&`, `{{^`, `{{>`, `{{<`, `{{#`, `/}}`, `{{$`, `{{!`, and `|`. TODO: ^^ Badly worded sentence ^^ TODOS: Gotta describe base templates somewhere. (the same way we describe the partials) ### Tags #### Variables In order to display a scalar (not-list) value in your template, simply wrap it in double curly braces. e.g. `{{ page.title }}`. This content will be HTML escaped (for safety), so if the value you're rendering contains HTML, you'll need to use the raw syntex instead `{{& page.title}}`[^raw] which will output the value without stripping or re-writing content. [^raw]: Official Triple brace syntax (`{{{ raw }}}`) is also supported, but `{{& raw }}` is preferred, as it's easy to accidentily insert too many braces. In most[^most] cases, invalid keys will be silently ignored (nothing between the braces will appear), in keeping with the official mustache spec. [^most]: TODO: in what cases won't it? spelllcheck + strict mode? Leading and trailing whitespace(s) are ignored by the parser, so the folllowing are all equivilent: `{{& title }}`, `{{&title}}`, `{{& title}}`. #### Sections TODO: #### Inverted Sections TODO: #### Partials TODO: TODO: Talk about MAX_CONTEXT_DEPTH (currently 16) and how it limits the total number of nested templates to 13. (3 for `[site, page, ctx]`) ##### Dynamic Partials #### Blocks TODO: #### Parents TODO: #### Summary `{{page.title}}` for normal values `{{&page.title}}` for values that contain HTML. `