Skip to content

Issues gather

True1023 edited this page May 31, 2018 · 1 revision
  1. Q: jekyll 目前支持 _post 目录下多级目录和中文路径,但本地预览时,如果markdown文件名是中文的,会导致无法无法访问。

    A: 修改安装目录\Ruby22-x64\lib\ruby\2.2.0\webrick\httpservlet下的filehandler.rb文件,建议先备份。 找到下列两处,添加一句( + 的一行为添加部分)

      path = req.path_info.dup.force_encoding(Encoding.find("filesystem"))
             + path.force_encoding("UTF-8") # 加入编码
             if trailing_pathsep?(req.path_info)
    
      break if base == "/"
      + base.force_encoding("UTF-8") # 加入編碼
      break unless File.directory?(File.expand_path(res.filename + base))
    

    然后重启服务器即可jekyll clean && jekyll s

Clone this wiki locally