Hexo

Hexo Change Default to Page

Published
On this page
  1. Concept
  2. If you want to display your custom page by default instead of the “blog page”, follow steps below.

I wrote this in 2023 for the old version of this site, which ran on Hexo. It runs on Astro now, so these steps may no longer apply.

Concept

  1. First we need understand how Hexo’s blog page works.
  • By default, Hexo will create a blog page that will showcase all your posts. Refer to this.
  • Hexo creates a index.html, which is your blog page, when deploy using hexo d or hexo deploy.
  • This is all based on the pre-installed module hexo-generator-index, which you can config under _config.yml file:
yml
index_generator:
  path: ''
  per_page: 10
  order_by: -date
  • the value from path adds suffix to your website url.

If you want to display your custom page by default instead of the “blog page”, follow steps below.

  1. Deploy your blog page somewhere else.
  • Go to file _config.yml, find these lines:
    yml
    index_generator:
      path: ''
      per_page: 10
      order_by: -date
  • Edit value in path, for example I change to follow:
    yml
    index_generator:
      path: 'blog'
      per_page: 10
      order_by: -date
  • After first step, you will get error when trying to accessing your website’s main url, as the index.html is not auto-generated anymore. Therefore you will need to create a index.md file under source folder manually.
  1. Create your own default page.
  • Create a index.md under source folder. Other naming will require additional works. So we are stick to index.md in this case.
    • Type in Hello World! in your index.md.
  • You are all set! Run hexo g && hexo s and you shall see your Hello World! message.
  1. You can edit your index.md to show all your writings, all your posts and pages.
  2. Visit mine for an idea!

Check these too!

More posts from Jack's Space.

Jack Lee

Senior Software Engineer at Squarebox Technology

14 posts 5 topics 10 tags

Running for
1,324 days
Visitors
–
Last update
9 Oct 2026