gohugoio / hugo

The world’s fastest framework for building websites.
https://gohugo.io
Apache License 2.0
74.63k stars 7.45k forks source link

Cannot find partials for layouts/index.html #1533

Closed duckpuppy closed 7 years ago

duckpuppy commented 8 years ago

I'm using Hugo with the RedLounge theme. I wanted to customize the layouts/index.html page. To start, I copied themes/hugo-redlounge/layouts/index.html to layouts/index.html. At that point, without modifying anything, I get the following errors trying to run hugo

ERROR: 2015/10/29 Unable to render [partials/header.html theme/partials/header.html]
ERROR: 2015/10/29 Expecting to find a template in either the theme/layouts or /layouts in one of the following relative locations [partials/header.html theme/partials/header.html]
ERROR: 2015/10/29 Unable to render [partials/sidebar.html theme/partials/sidebar.html]
ERROR: 2015/10/29 Expecting to find a template in either the theme/layouts or /layouts in one of the following relative locations [partials/sidebar.html theme/partials/sidebar.html]
ERROR: 2015/10/29 Unable to render [partials/listtop.html theme/partials/listtop.html]
ERROR: 2015/10/29 Expecting to find a template in either the theme/layouts or /layouts in one of the following relative locations [partials/listtop.html theme/partials/listtop.html]
ERROR: 2015/10/29 Unable to render [partials/footer.html theme/partials/footer.html]
ERROR: 2015/10/29 Expecting to find a template in either the theme/layouts or /layouts in one of the following relative locations [partials/footer.html theme/partials/footer.html]
ERROR: 2015/10/29 Unable to render [partials/bodyend.html theme/partials/bodyend.html]
ERROR: 2015/10/29 Expecting to find a template in either the theme/layouts or /layouts in one of the following relative locations [partials/bodyend.html theme/partials/bodyend.html]

The themes/hugo-redlounge/layouts folder has the following contents:

themes/hugo-redlounge/layouts
├── _default
│   ├── list.html
│   └── single.html
├── index.html
└── partials
    ├── authorsocial.html
    ├── bodyend.html
    ├── doctype.html
    ├── footer.html
    ├── headend.html
    ├── header.html
    ├── listtop.html
    ├── meta.html
    ├── og.html
    ├── sidebar.html
    ├── sidebarheader.html
    ├── singletop.html
    ├── socialsharing.html
    └── syntaxhighlight.html

2 directories, 17 files

The error seems to indicate that it should be looking for those partials in the theme/layouts/partials folder if they don't exist in the layouts/partials folder, but it's not finding them. The hugo command works just fine if I remove the layouts/index.html file.

bep commented 8 years ago

What Hugo version and OS are you running?

duckpuppy commented 8 years ago

OS X El Capitan and hugo 0.14, though I also checked out the code and built from source with the same results. I've done some hacking to see if I could figure out what's happening, but I'm still pretty new to go.

waddlesplash commented 8 years ago

Same issue here. I can't figure out what Hugo is rendering when the errors are triggered.

petarjs commented 8 years ago

Hey guys, I just got the same error, and it seems that you must specify the theme when running the build.
So instead of just

$ hugo

you do

$ hugo -t hugo_theme_robust

found the info here https://gohugo.io/themes/usage/

FilBot3 commented 7 years ago

This worked for me on Windows 7. I didn't see this in the Usage page, where it was talking about generating the site. Maybe I needed to get further in the documentation.

github-actions[bot] commented 2 years ago

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.