Skip to content
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 · 2 comments
Closed

Unable to locate baseof.ace from theme #1215

trombonehero opened this issue Jun 19, 2015 · 2 comments
Labels

Comments

@trombonehero
Copy link
Contributor

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
When we find a template that requires a base template, we should also look
for that base template in the current theme.

Fixes gohugoio#1215.
@bep
Copy link
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 as completed in 0987e98 Jun 25, 2015
tychoish pushed a commit to tychoish/hugo that referenced this issue Aug 13, 2017
When we find a template that requires a base template, we should also look
for that base template in the current theme.

Fixes gohugoio#1215.
bep added a commit that referenced this issue Sep 7, 2020
d3eb97a33 Document .IsSection page variable
a068bcf5c Ace and Amber support was removed with #6609
5cd9ca4b2 Mention MacPorts also on the Installing page  (#1215)
0ae8f5c19 Add instructions for using Macports
d50aba8f0 Revise ref and relref function pages
a17e25d6f Update quick-start.md: move notice about drafts up
cf87a5da2 Update macOS tarball installation instructions (#1203)
2e701f8f3 Corrected the url for index function link
736bd59e0 Clarify treatment of zero weights (#1207)
42a19f479 Fix example of output from urlize function
34f8de26d Revise content-management/cross-references
252435a95 Rewrite Translation of Strings
f0882bc14 Remove note that has been outdated by v0.71.0
dfe28ceb5 Improve mounts module config
58029627d Fix erroneous example code piping to if

git-subtree-dir: docs
git-subtree-split: d3eb97a3328f5390801bbce017233ce895fc2d28
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants