New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to locate `baseof.ace` from theme #1215

Closed
trombonehero opened this Issue Jun 19, 2015 · 1 comment

Comments

Projects
None yet
2 participants
@trombonehero
Contributor

trombonehero commented Jun 19, 2015

As shown in my reduced test case, there is a problem when rendering ACE base templates in themes. In that test case, I have a layouts/index.ace that provides content to be rendered by the theme's layouts/_defaults/baseof.ace (whose full path is themes/demotheme/layouts/_defaults/baseof.ace). At tpl/templates.go:307, however, only four paths are checked for baseof.ace:

pathsToCheck := []string{
    filepath.Join(templateDir, currBaseAceFilename),
    filepath.Join(templateDir, baseAceFilename),
    filepath.Join(absPath, "_default", currBaseAceFilename),
    filepath.Join(absPath, "_default", baseAceFilename)}

which translates to:

checking: '/Volumes/Dev/hugo-bugs/baseoface/layouts/index-baseof.ace'
checking: '/Volumes/Dev/hugo-bugs/baseoface/layouts/baseof.ace'
checking: '/Volumes/Dev/hugo-bugs/baseoface/layouts/_default/index-baseof.ace'
checking: '/Volumes/Dev/hugo-bugs/baseoface/layouts/_default/baseof.ace'

Notably, the theme directory is not checked. The theme directory is consulted when we're looking for templates in it via a call to loadTemplates('/Volumes/Dev/hugo-bugs/baseoface/themes/demotheme/layouts', 'theme'), but at that point it's too late: we've already failed to find the base template for my index.ace.

trombonehero added a commit to trombonehero/hugo that referenced this issue Jun 19, 2015

Add support for baseof.ace templates in themes.
When we find a template that requires a base template, we should also look
for that base template in the current theme.

Fixes #1215.
@bep

This comment has been minimized.

Show comment
Hide comment
@bep

bep Jun 19, 2015

Member

You are right. When I wrote this I implemented my needs ... I didn't think of the themes.

Member

bep commented Jun 19, 2015

You are right. When I wrote this I implemented my needs ... I didn't think of the themes.

@bep bep closed this in 0987e98 Jun 25, 2015

tychoish added a commit to tychoish/hugo that referenced this issue Aug 13, 2017

Add support for baseof.ace templates in themes.
When we find a template that requires a base template, we should also look
for that base template in the current theme.

Fixes #1215.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment