Ace Templates Dead?

Hi,
thanks for this awesome discussion board! (This is my first post :slight_smile: )

I’m starting to use Hugo on more and more sites that I create and I was wondering if the template engine Ace is dead or still being used/supported?

I saw a bunch of posts in 2015 but after that not much anymore. The guthub project seems to be stale as well.

Any insights if this is still in use/supported? I tried to get this working but failed (at least with baseof and partials).

Thanks a ton.

Mila

I think that your best bet is to use the stock Go Templates with Hugo, instead of Ace or Amber.

Thanks for the reply.

I come from middleman/jekyll and ruby and am used to haml(slim) that’s why I liked the Ace templates :slight_smile:

I understand. However as you noticed those templates engines have become stale.

The Ace template library we use are actively maintained:

I really like Ace myself, but after we got base template support for Go templates, it got less interesting. It looks good, but the “indentation syntax” makes it a little harder to write without good editor support.

2 Likes

Interesting.
Thanks.

You got Ace to work with the base template? I struggled to get it all going together. Can you provide insights what I might have done wrong?

I tried with a _default/baseof.ace, _default/list.ace and an index.ace but failed to get it working.

edit: It is really hard to debug. there are no error messages at all and I agree the indentation makes it really hard

layouts/_default/baseof.ace

= doctype html
html lang=en
  head
  body
    {{ block "main" . }}
    {{ end }}

layouts/index.ace

{{ define "main" }}
.content
  {{.Content}}
{{end}}

@bep after your comment I tried again for the last half hour and I think I have it working the way it’s intended. The documentation needs some update I guess:

layouts/_default/baseof.ace

= doctype html
html lang=en
  head
  body
    = yield main

layouts/index.ace

= content main
  .content
    {{.Content}}

this seems to be working.
Thank you.

You could be one of the most qualified Ace users at this moment. :slight_smile:

Please send a PR to the hugoDocs repo.

1 Like