hexojs / hexo

A fast, simple & powerful blog framework, powered by Node.js.
https://hexo.io
MIT License
39.19k stars 4.82k forks source link

Could I use custom index page? #415

Closed jewian closed 9 years ago

jewian commented 10 years ago

I would like to use Hexo to generate blog page to the sub-directory xxxx.com/blog/.

In the meanwhile, I would like to create a custom index page xxxx.com/index.html (and maybe other custom pages like xxx.com/photos.html).

And the whole personal site (custom pages + Hexo generated blog pages) will be hosted by GitHub.

Could I do that?

tommy351 commented 10 years ago
  1. Disable index generator. Modify your _config.yml.

    exclude_generators:
    - index
  2. Add index.md to source folder.
jewian commented 10 years ago

I tried as you mentioned.

However, source/index.md will be always generated into xxxx.com/blog/index.html.

What I expect is that xxxx.com/blog/index.html still keeps the original posts. However I need an extra front page xxxx.com/index.html

tommy351 commented 10 years ago

What's your root setting?

jewian commented 10 years ago

url: http://xxxx.com/blog root: /blog/

That is why I would like to make HEXO generated files under the sub-directory "blog". And I would like my xxx.com/index.html to be a custom font page instead of simply redirecting to the /blog/index.html.

tommy351 commented 10 years ago

Remove blog/ from the url and root setting.

Xuanwo commented 10 years ago

If your problem solved, pleased the issues, spare more space for the new-comer, thanks.

btbinhtran commented 10 years ago

Your answer did not resolve the problem. I would like a resolution to @jewian's question.

seejessicacode commented 9 years ago

I too am interested in a solution to @jewian's question. Implementing the proposed solutions do not direct my posts to the /blog/ directory. I would prefer to keep the front page in the same project as the blog so that I can use the same theme sources.

smmoosavi commented 9 years ago

config:

# URL
root: /
permalink: blog/:year/:month/:day/:title/
archive_dir: blog

# Extensions
exclude_generator:
- index
seejessicacode commented 9 years ago

@smmoosavi 's solution works for me. I propose @jewian try it and close the issue if it works for them too.

ianpogi5 commented 8 years ago

To remove auto generated index.html, uninstall hexo-generator-index

npm remove hexo-generator-index