2

My blog is based on Github Pages and the program I'm using is HEXO

the files that are generated by HEXO don't contain a README.md file so I can't make a declaration of my blog on Github repo page.So I want to add a README.md file to the folder that HEXO generates.I've tried that add it manually to the folder after using $ HEXO g and it is added to successfully.But the problem is that every time I use $ HEXO g,the file I added will be deleted by the program.
So I want to that is there any method that make the HEXO program generate a README.md file to the blog's root directory automatically everytime I run $ HEXO g?
thanks everybody.

BBBBB
  • 37
  • 1
  • 10

4 Answers4

2

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.

Spark.Bao
  • 5,573
  • 2
  • 31
  • 36
1

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

Edit: you can also try Jekyll

David Jacquel
  • 51,670
  • 6
  • 121
  • 147
  • NO,i want a README.md file generated in the `/public` directory I've tried add a README.md file to the `/source` directory but after i run `$HEXO g` it become README.html.So your solution doesn't work. – BBBBB Aug 13 '14 at 14:37
0

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

fdaciuk
  • 1
  • 1
0

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

ronan
  • 1,611
  • 13
  • 20