2015-04-18 14:23:14 -04:00
---
aliases:
- /doc/templates/ace
- /layout/templates/ace
- /layout/ace/
2016-01-06 17:45:19 -05:00
lastmod: 2015-08-04
2015-04-18 14:23:14 -04:00
date: 2014-04-20
linktitle: Ace templates
menu:
main:
parent: layout
next: /templates/functions
prev: /templates/go-templates
2015-07-20 08:49:18 -04:00
title: Ace Templates
2015-04-18 14:23:14 -04:00
weight: 17
---
2015-07-20 18:29:36 -04:00
In addition to [Go templates ](/templates/go-templates ) and [Amber ](/templates/amber ) templates, Hugo supports the powerful Ace templates.
2015-04-18 14:23:14 -04:00
2015-08-04 14:00:08 -04:00
For template documentation, follow the links from the [Ace project ](https://github.com/yosssi/ace ).
2015-04-18 14:23:14 -04:00
* Ace templates must be named with the ace-suffix, e.g. `list.ace`
* It's possible to use both Go templates and Ace templates side-by-side, and include one into the other
* Full Go template syntax support, including all the useful helper funcs
* Partials can be included both with the Ace and the Go template syntax:
* `= include partials/foo.html .` [^ace-theme]
* `{{ partial "foo" . }}`
2015-04-18 17:06:14 -04:00
One noticeable difference between Ace and the others is the inheritance support through [base and inner templates ](https://github.com/yosssi/ace/tree/master/examples/base_inner_template ).
2015-04-18 14:23:14 -04:00
2016-12-15 16:02:21 -05:00
In Hugo the base template will be chosen with the same ruleset as for [Go templates ](/templates/blocks/ ).
2015-04-18 14:23:14 -04:00
.:
index.ace
./blog:
single.ace
baseof.ace
./_default:
baseof.ace list.ace single.ace single-baseof.ace
```
Some examples for the layout files above:
2015-08-04 14:00:08 -04:00
* Home page: `./index.ace` + `./_default/baseof.ace`
2015-04-18 14:23:14 -04:00
* Single page in the `blog` section: `./blog/single.ace` + `./blog/baseof.ace`
* Single page in another section: `./_default/single.ace` + `./_default/single-baseof.ace`
* Taxonomy page in any section: `./_default/list.ace` + `./_default/baseof.ace`
2015-04-18 17:06:14 -04:00
**Note:** In most cases one `baseof.ace` in `_default` will suffice.
**Note:** An Ace template without a reference to a base section, e.g. `= content` , will be handled as a standalone template.
2015-04-18 14:23:14 -04:00
2017-06-13 12:54:42 -04:00
[^ace-theme]: Note that the `html` suffix is needed, even if the filename is suffixed `ace` . This does not work from inside a theme, see [issue 763 ](https://github.com/gohugoio/hugo/issues/763 ).
2015-04-18 14:23:14 -04:00