Octopress在新职位上的资本化

Rob*_*lar 3 markdown jekyll octopress

今天我更新了我的Octopress博客,当我运行时:

rake new_post["This is a test of title"]
Run Code Online (Sandbox Code Playgroud)

它在source/_post/2013-02-18-this-is-a-test-of-title.markdown中创建我的markdown文件,然后运行:

rake generate
Run Code Online (Sandbox Code Playgroud)

rake preview
Run Code Online (Sandbox Code Playgroud)

而这篇文章现在有了标题

This Is A Test Of Title
Run Code Online (Sandbox Code Playgroud)

我查看了降价的来源并找到了

...
title: "This is a test of title"
...
Run Code Online (Sandbox Code Playgroud)

降价很好.同样在网页中我使用Chrome的开发者工具来查看css属性是否具有'capitalize'的值,但它没有,锚点看起来像这样

<a href="...">This Is A Test of Title</a>
Run Code Online (Sandbox Code Playgroud)

所以看起来资本化的问题来自框架.

在imathis/octopress repostory的维基中https://github.com/imathis/octopress/issues/202似乎有些用其他语言发帖的人不喜欢这个'功能',甚至在Rakefile中,imathis删除了这一行:

post.puts "title: \"#{title.gsub(/&/,'&amp;').titlecase}\""
Run Code Online (Sandbox Code Playgroud)

对于这一个:

post.puts "title: \"#{title.gsub(/&/,'&amp;')}\""
Run Code Online (Sandbox Code Playgroud)

对于那个提交,所以我打开我的Rakefile,它有最后一行,所以我的文件是最新的,但显然问题仍然存在

任何想法如何避免帖子标题中的这种行为?

bwe*_*est 11

在_config.yml中,找到该行

titlecase: true       # Converts page and post titles to titlecase
Run Code Online (Sandbox Code Playgroud)

并将其设置为false.

有关更多信息titlecase.您还plugins/titlecase.rb可以查看它是如何工作的.