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

Translated templates don't use "untranslated" base template #3893

Closed
ngsctt opened this Issue Sep 21, 2017 · 0 comments

Comments

Projects
None yet
2 participants
@ngsctt

ngsctt commented Sep 21, 2017

I'm pretty sure this is a bug, although there could be some good reason for it that I'm not aware of.

In a site with the structure

content
├── posts
│   ├── index.md
│   ├── index.ja.md
layouts
├── _default
│   ├── baseof.ace
│   ├── list.ace
│   └── single.ace
└── posts
    ├── list.ace
    └── list.ja.ace

I'd expect the page /posts/ to use layouts/_default/baseof.ace with the layouts/_posts/list.ace, block, and I'd expect /ja/posts to use layouts/_default/baseof.ace with the layouts/_posts/list.ja.ace block.

/ja/posts works fine if there's no layouts/_posts/list.ja.ace template. As soon as that template is added, it won't make the page without adding a translated layouts/_default/baseof.ja.ace

Obviously some people will need to translate their base template as well, but shouldn't translated templates fall back to the base template with no language? Like how section/type templates work backwards in specificity? (eg. my comment on #3360)

At this point I either need to sort-of-pointlessly duplicate my baseof.ace to translate the template. Given how I'd expect a lot of people's base templates don't have any content in them, I imagine there are, or will be, other people running up against the same problem.

Hugo v0.27.1 darwin/amd64, on macOS 10.12.6

@bep bep added the Bug label Sep 21, 2017

@bep bep modified the milestones: v0.28, v0.29, v0.30 Sep 21, 2017

@bep bep modified the milestones: v0.30, v0.31 Oct 13, 2017

@bep bep modified the milestones: v0.31, v0.32 Oct 30, 2017

bep added a commit to bep/hugo that referenced this issue Nov 17, 2017

@bep bep closed this in #4097 Nov 17, 2017

bep added a commit that referenced this issue Nov 17, 2017

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