teXt使用

开始

运行bundle exec jekyll serve启动遇到一些问题,瞎试了几个命令,记录一下,希望能帮助到其他人:

  • 如果提示bundle版本有问题:
// 安装指定版本的bundler
gem install bundler -v 1.15
bundle _1.15_ install
  • 依赖有问题
// 如果执行了还一直报错,重开一个cmd再试试
bundle install --path vendor/bundle
gem update --system

一路都是坑

写好第一个md(也就是这个),运行,预览可以,点击进去显示404。
进行对比发现是文件名带了中文,网上找了一个解决方法

解决jekyll无法本地预览中文文件的问题

修改安装目录Ruby22-x64lib uby2.2.0webrickhttpservlet下的filehandler.rb文件,建议先备份。找到下列两处,添加一句(+的一行为添加部分)
1

path = req.path_info.dup.force_encoding(Encoding.find("filesystem"))
+ path.force_encoding("UTF-8") # 加入编码
if trailing_pathsep?(req.path_info)

2

break if base == "/"
+ base.force_encoding("UTF-8") #加入編碼
break unless File.directory?(File.expand_path(res.filename + base))

发现一个比较奇怪的地方,有些中文名可以,有些不可以,比如 丫.md不可以,丫头.md又可以。

原文地址:https://www.cnblogs.com/ylka/p/11120893.html