Ace base templates


#1

I’m having trouble getting ace templates to work with a base template. It works as expected if I implement this with html templates. I must be missing something really obvious?

version: Hugo Static Site Generator v0.25.1 darwin/amd64 BuildDate: 2017-07-20T09:47:54+09:00
env: OSX 10.12.2

layout/_default/baseof.ace

= doctype html
html lang=en
  head
    meta charset=utf-8
    title Single Template
  body
    h1 base template
    = yield main

layout/index.ace

= content main
	h1 this in index

The generated page source:

< h1>this in index</ h1>


#2

I’ve tried to implement with amber as well without any luck.

I’ve followed the guides here: https://gohugo.io/templates/alternatives/
and here: https://github.com/yosssi/ace/tree/master/examples/base_inner_template

Are there any example repos of ace/amber with base templates to look at?

Would love some help from anyone who’s tried this as it sounds like ace is the way to go for templating.


#3

You can try looking at an old version of bep’s site. He has since replaced all of his ace templates with HTML.


#4

Thanks for the tip. I’ve tried looking through his repo but haven’t been able to get it working with the ace base templates.

I’ll just go ahead with html templates, and hopefully someone can share a working version.


#5

I would recommend Go templates.

If you need help with Ace, I can look at it, but you need a concrete and failing repo that I can look at.


#6

Thanks, that would be helpful! I’ve created a repo here: https://github.com/richygit/acetemplates

In the process of making this repo, it actually worked as expected. Then I edited the file to remove a line and then it stopped working and produced the unexpected results as reported. From there I couldn’t get it to work again =( Hopefully you are able to reproduce.

Environment is the same as in the original post.