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

templates.Exists cannot find layout #9477

Closed
jmooring opened this issue Feb 9, 2022 · 2 comments · Fixed by #9479
Closed

templates.Exists cannot find layout #9477

jmooring opened this issue Feb 9, 2022 · 2 comments · Fixed by #9479
Assignees
Milestone

Comments

@jmooring
Copy link
Member

jmooring commented Feb 9, 2022

hugo v0.93.0-DEV-92627190+extended linux/amd64

layouts/
├── _default/
│   ├── baseof.html
│   ├── home.html
│   ├── list.html
│   └── single.html
└── post/
    └── single.html
{{ templates.Exists "post/single.html" }} --> false
{{ templates.Exists "/post/single.html" }} --> false
{{ templates.Exists "layouts/post/single.html" }} --> false
{{ templates.Exists "/layouts/post/single.html" }} --> false

According to the documentation I expected the first one to work.

It also returns false for templates in mounts.

git clone --single-branch -b hugo-github-issue-9477 https://github.com/jmooring/hugo-testing hugo-github-issue-9477
cd hugo-github-issue-9477
hugo server

Then visit http://localhost:1313/tests/test-1/

@bep bep removed the NeedsTriage label Feb 9, 2022
@bep bep added this to the v0.93.0 milestone Feb 9, 2022
@bep bep self-assigned this Feb 9, 2022
@bep
Copy link
Member

bep commented Feb 9, 2022

It's probably the base template that confuses things ... I guess I have only used this for partials.

@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 Feb 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants