Hexo: WARN No layout: index.html

Created on 6 Feb 2015  ·  14Comments  ·  Source: hexojs/hexo

I just download install Hexo version 3.0.0-rc.2

I followed the steps and created the blog site. Now when I try to load it in my browser I get the following message in the console where the server is running:

blog % hexo server
INFO  Hexo is running at http://0.0.0.0:4000/. Press Ctrl+C to stop.
WARN  No layout: index.html

Also when I do:

blog % hexo new "Hello Hexo"
blog % hexo generate
INFO  Files loaded in 403 ms
WARN  No layout: 2015/02/06/Hello-Hexo/index.html
WARN  No layout: 2015/02/06/Hello-Hexo/index.html
INFO  Generated: 2015/02/06/Hello-Hexo/index.html
WARN  No layout: 2015/02/06/hello-world/index.html
WARN  No layout: 2015/02/06/hello-world/index.html
INFO  Generated: 2015/02/06/hello-world/index.html
WARN  No layout: archives/index.html
WARN  No layout: archives/index.html
INFO  Generated: archives/index.html
WARN  No layout: archives/2015/index.html
WARN  No layout: archives/2015/index.html
INFO  Generated: archives/2015/index.html
WARN  No layout: archives/2015/02/index.html
WARN  No layout: archives/2015/02/index.html
INFO  Generated: archives/2015/02/index.html
WARN  No layout: index.html
WARN  No layout: index.html
INFO  Generated: index.html
INFO  6 files generatd in 31 ms

And the browser remains completely white. Did I do something wrong or could this be an (known) issue ?

Most helpful comment

This usually happens when you don't have a an index template.

Check inside your themes/your-theme/layout/ folder for a file called index.ejs (The ejs part could change if you use jade or swig for templates)

All 14 comments

This usually happens when you don't have a an index template.

Check inside your themes/your-theme/layout/ folder for a file called index.ejs (The ejs part could change if you use jade or swig for templates)

There's nothing in that directory. However, if I do:

git clone https://github.com/hexojs/hexo-theme-landscape.git themes/landscape

It works!

Following the steps on http://hexo.io/ this should not be necessary. So I guess one ore more themes should be available by default right ?

The steps in the site refer to version 2.8.3. My guess is that they'll be updated once 3.0.0 ships.

You should check the Wiki section of this repo if you're using the Betas/Release Candidates.

ok, thanks.

So, please close it

I have a default.swig" file in the layout directory of my theme. Copying it toindex.swig` has no result.

I have the same problem! How does it get work?

Just check if everything is right in your themes/

I meet the same question,but I don't know how to fix it,

I came across this -- in my case because I renamed my theme directory but neglected to update _config.yml to the new name. Your mileage may vary.

I found the _config.yml of my themes was error. So I think you can try to check your _config.yml in this link: yaml-validator

@celsomiranda Thank you! You're right. The theme folder is empty.

Things to check:
1) validate ./_config.yml (https://yaml-online-parser.appspot.com/)
2) verify ./_config.yml's theme: entry is a directory in ./themes
3) verify ./themes/[themedir]/_config.yml is valid
4) verify post's front matter is valid yml
5) verify post's front matter layout: entry is a file (w/o extension) in ./themes/[themedir]/layout/[name]

If you make any changes to _config files, restart the hexo server.

If that doesn't work, check your renderer packages. I was using a broken pug plugin. Prefer:
npm install hexo-renderer-jade --save

@MichaelJCole great debugging tips!

What also helps when debugging your own theme is to run hexo clean before hexo generate and to remove other themes within the "themes" directory.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

leoli-dev picture leoli-dev  ·  3Comments

enterhuiche picture enterhuiche  ·  3Comments

testareas picture testareas  ·  3Comments

mashirozx picture mashirozx  ·  3Comments

19uni94 picture 19uni94  ·  3Comments