hexojs / hexo

A fast, simple & powerful blog framework, powered by Node.js.
https://hexo.io
MIT License
39.22k stars 4.82k forks source link

Capitalization of Hexo blog posts #679

Closed andrewboni closed 9 years ago

andrewboni commented 10 years ago

If I write the following:

hexo n "This is an Awesome Blog Post"

The slug that is generated is /2014/06/15/This-is-an-Awesome-Blog-Post/, which is different from the behavior of, say, Octopress. Octopress automatically lowercases all slugs (as do most other static blogs and CMSs).

I realize that there is the titlecase: true options in _config.yml, but many times I want custom capitalization in my titles.

The ideal scenario would be:

hexo n "This is an Awesome Blog Post"
hexo n "THIS IS AN AWESOME BLOG POST"
hexo n "This Is An AwEsOme Blog PoSt"

Thoughts?

eacku commented 10 years ago
1,hexo n "This is an Awesome Blog Post"
2,hexo n "THIS IS AN AWESOME BLOG POST"
3,hexo n "This Is An AwEsOme Blog PoSt"

the slug attribute is related to the basename of .md file created by running `hexo n '.

if [1,2,3]==> the same style filename `this-is-an-awesome-blog-post.md` :
    see: hexo/lib/plugins/console/new.js
if [1,2,3]  !==> the same style filename `this-is-an-awesome-blog-post.md` but have the same slug `this-is-an-awesome-blog-post`:
    see: hexo/lib/plugins/console/processor/post.js
the hexo n <name> -s <slug>
the permalink attribute in front-matter 
also affect the slug attribute

you know what i mean? P.S.英语不好,表达的不清楚请见谅 :)

tommy351 commented 10 years ago

The titlecase setting is used in post title, not here. You should use filename_case setting instead.

jaredly commented 10 years ago

The docs claim that the slug & filename will be lowercase, but this is not the case :( wish it were

Xuanwo commented 10 years ago

titlecase: false And it will be OK.

leesei commented 9 years ago

I confirm titlecase setting in Hexo _config.yml works. Please close this issue.

bennycode commented 3 years ago

Setting filename_case to 1 did the trick for me!