How to add route for Hexo?
If you need a page about
:
run
hexo new page "about"
You will find an
about
folder in thesource
folder. You can edit theindex.md
file in theabout
folder.add code
About: /about
in themenu
section of_config.yml
file in your theme folder. Preview your site :)
You have to create a new page by runnning hexo new page "about"
. A folder will be created in source/
. In this folder, there is a file named index.md
. In this file, you can write the content of this page /about
in markdown.
This page will be displayed as a post page
layout, if you want an other layout and style, define in front-matter, the layout with layout: YOUR_LAYOUT
. Of course, you have to create this layout in the layout
folder of your theme folder. The layout name will be the name of the file.