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

WARN No layout: index.html #1037

Closed
scaljeri opened this issue Feb 6, 2015 · 17 comments
Closed

WARN No layout: index.html #1037

scaljeri opened this issue Feb 6, 2015 · 17 comments

Comments

@scaljeri
Copy link

scaljeri commented Feb 6, 2015

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 ?

@celsomiranda
Copy link

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)

@scaljeri
Copy link
Author

scaljeri commented Feb 7, 2015

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 ?

@celsomiranda
Copy link

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.

@scaljeri
Copy link
Author

scaljeri commented Feb 8, 2015

ok, thanks.

@Xuanwo
Copy link
Contributor

Xuanwo commented Feb 8, 2015

So, please close it

@scaljeri scaljeri closed this as completed Feb 8, 2015
@gringolalia
Copy link

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

@Rehoni
Copy link

Rehoni commented Oct 16, 2016

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

@selmalee
Copy link

selmalee commented Nov 3, 2016

Just check if everything is right in your themes/

@liumingming123
Copy link

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

@JohnLockwood
Copy link

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.

@mofeiyu
Copy link

mofeiyu commented Apr 30, 2017

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

@VictorZhang2014
Copy link

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

@MichaelJCole
Copy link

MichaelJCole commented Feb 13, 2018

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

@bennycode
Copy link

@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.

@hitsmaxft
Copy link

hitsmaxft commented Feb 14, 2024

Configuration Files

After the installation of Hexo and NexT, you may found that there are two configuration files using by Hexo and both called _config.yml:

    The first one is under site root directory, which contains Hexo's config.
    The second one is under theme root directory (e.g. themes/next/_config.yml or node_modules/hexo-theme-next/_config.yml), which is provided by NexT and contains theme's config.

Let's call the first one – Hexo config file, and the second one – NexT config file.

https://theme-next.js.org/docs/getting-started/#Configuration-Files

next's document still tell user to place theme config under themes/next/_config.yml , which only works for themes that copy in to ./themes/{theme-name}
But to users install next-theme by npm i hexo-theme-next, this way will break hexo server.

_config.{theme-name}.yml is a safe way to add theme-config , and should be recommended as highest priorly .

@stevenjoezhang
Copy link
Member

@hitsmaxft I'm afraid you misunderstood the NexT documentation. Below the section you quoted, the documentation strongly advises against using themes/next/_config.yml and tells the correct way of using _config.{theme-name}.yml.
截屏2024-02-24 16 40 35

@hitsmaxft
Copy link

@hitsmaxft I'm afraid you misunderstood the NexT documentation. Below the section you quoted, the documentation strongly advises against using themes/next/_config.yml and tells the correct way of using _config.{theme-name}.yml. 截屏2024-02-24 16 40 35

The second way should only used by users who clone Next source code into ./themes/next/. It's harmfully to show up here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests