新建页面
hexo new page "新建博文章的名称"
这时会在工程的source目录下新建about目录,里面新建index.md
在主题的_configy.yml中配置新页面的菜单
menu:
首页: /
所有文章: /archives
分类: /categories
标签: /tags
About: /about
在主题的layout目录下新建about.ejs(新建页面的h5代码)
about.ejs中写入页面代码
在source/about/index.md中加入:
layout: about
---
title: about
date: 2019-07-07 16:08:51
layout: about
---
about.ejs可以调用内置的一些方法或对象,比如可以把tags.ejs代码拷贝过来,这样about页就跟标签列表页一样了
自定义首页
由于只能在首页和文章列表页获取文章信息(比如把index.ejs代码copy到上面的about.ejs会报错),所以如果要自定义首页,又要保留原来首页内容,只能把原来首页代码copy到文章列表页,把文章列表页去掉(index.ejs->archive.ejs),然后在原来的index.ejs中放入新的首页代码