How do I add a README.md file into the root directory of the generated blog by HEXO?

谁说我不能喝 提交于 2019-12-06 08:16:14

I have write a blog to show how to add README.md to hexo and how to keep all .md files in hexo (for version control), but it's in chinese. :)

At first, you need put README.md under source folder, but it's not enough.

In _config.yml, there is a field called skip_render (if it's not exist, create it), you must declare README.md or any other files that need to keep its original format under source folder after this filed, like this:

skip_render: README.md

if you want to keep more than one file, do like this:

skip_render: [README.md, ori_data/*, ori_data/posts/*, ori_data/tags/*, ori_data/categories/*, ori_data/themes/next/*]

my folder tree is like this:

D:\hexo_blog>tree source /F
D:\HEXO_BLOG\SOURCE
│  README.md
│
├─categories
│      index.md
│
├─ori_data
│  │  config.yml
│  │
│  ├─categories
│  │      index.md
│  │
│  ├─posts
│  │      2013-02-05-my-blog-in-github.md
│  │      2013-02-06-resolve-goagent-cp65001.m
│  │      2013-03-11-c_stack.md
│  │      2015-05-03-hello-hexo.md
│  │
│  ├─tags
│  │      index.md
│  │
│  └─themes
│      └─next
│              config.yml
│
├─tags
│      index.md
│
└─_posts
        2013-02-05-my-blog-in-github.md
        2013-02-06-resolve-goagent-cp65001.md
        2013-03-11-c_stack.md
        2013-03-18-understand_typdef_funp.md
        2013-03-24-understand_container_of.md
        2015-05-03-hello-hexo.md

some notices: the file that want to keep origin format must not start with '_', else it will be ignored when 'hexo generate'.

BTW: I used hexo 3.0.1.

Did you tried to create your file in sources folder ? See EXO doc

Edit: you can also try Jekyll

You can use README.mdown file in your source directory :)

Hexo has its own repositories in you github page.

You don't have to add readme.md by using hexo command.

Just go to that repositories page, and you'll a hint said "Help people interested in this repository understand your project by adding a README!".

There's a button next to it. Click and begin to Write

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!