Hexo设置自定义指定首页
Hexo搭建的博客,网址输入后直接打开的是自己想要的某个文章页面,查了半天,有解决方法了。
Confirming that simply creating an index.md file in the my-site/source folder allows me to change the homepage.
I still wished to have a page which listed my most recent blog posts. So in my my-site/_config.yml I put
index_generator:
#path: ‘’ # DELETE
path: ‘/blog’
After creating the file (and running hexo g hexo s), when I access localhost:4000, I get my custom homepage. And then when I access localhost:4000/my-site/blog, I get the “original” homepage listing my blog posts.
I did not need to npm uninstall hexo-generator-index. I also did not need to create an html file, and did not need to do what @MoezGholami says above.
hexo: 3.7.1
hexo-cli: 1.1.0
总之就两步操作:
1.在网站my-site/source目录下创建index.md文件
2.修改index_generator下面的path值为’/blog’
设置后重新运行网站,打开后浏览博客Home页就是设置的index.md写的内容