Github页面无法正确显示降价 [英] Github pages cannot display markdown correctly

查看:102
本文介绍了Github页面无法正确显示降价的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用github页面+ jekyll建立我的博客。

在推送我的最新提交之前,它正常运行。这个提交添加了一个cname文件,只是编辑了一些文字而没有对我的网站架构进行任何改动。

   - < h3 class =description> aaaaaaaaaa< / h3> 
+< h3 class =description> bbbbbbbbbb< / h3>

之后,减价不会正常显示。

当我写#head1。它没有出现标题head1,它只是直接出现在#head1中。


src =https://i.stack.imgur.com/j2vpF.pngalt =

这是我的_config.yml:


降价:kramdown

markdown_ext:降价,mkd,mkdn,md

textile_ext:纺织

highlighter:pygments


任何想法导致此错误?

解决方案

更新!



这很可能是由于 Jekyll 3 upgrade on GitHub Pages



从2016年5月1日起,GitHub不会支持 rdiscount redcarpet 了。此外,自2月1日起,GitHub Pages仅支持 rouge
$ b


从5月1日开始,2016年,GitHub Pages仅支持kramdown,
Jekyll的默认Markdown引擎。


$ b GitHub Pages现在只支持
Rouge。


您可以查看此此处

为了解决这个问题,请按以下步骤操作:

首先尝试在此答案中解释。而不是 #Heading ,你会写#Heading



<第二,调整您的 _config.yml :更改荧光笔降价

  highlighter:rouge 
markdown:kramdown
kramdown:
input: GFM

第三,要在本地构建您的站点,请使用 Bundler ,方法 GitHub推荐


  1. 安装Bundler:

      gem install bundler 


  2. 然后运行 bundle update - 这会更新所有宝石,包括 github-如果你已经在本地安装了这个gem,那么你就可以使用它。

  3. 然后,创建一个 Gemfile (不要离开任何文件扩展名)包含以下内容:

      source'https://rubygems.org'
    gem'github -bages'


将它保存到您项目的根目录。


  1. 然后,运行 bundle install 你的项目。这将创建一个名为 Gemfile.lock 的文件,并将安装所有必需的gem及其依赖关系


  2. 最后,运行 bundle exec jekyll serve --watch ,您就可以在网上查看您的网站了










$ b




PS。如果您的项目需要更多宝石,例如 jekyll-paginate jekyll-mentions ,您需要将它们添加到 Gemfile ,例如:

  source'https:// ruby​​gems .org'
gem'github-pages'
gem'jekyll-paginate'

另外,将它们添加到您的项目的 _config.yml

 宝石:
- jekyll-paginate
- jekyll-mentions

将会看到目前由GitHub Pages支持的gem版本的列表。在这里您可以阅读将Jekyll 2升级到3



希望有所帮助!


I am using github pages + jekyll to establish my blog.

It worked properly before pushed my latest commit. This commit adds a cname file and just edits some words without any alterations over the architecture of my site.

-    <h3 class="description">aaaaaaaaaa</h3>
+    <h3 class="description">bbbbbbbbbb</h3>

After that markdown does not appear properly.

When I write #head1. It does not appear title head1, it just appears #head1 directly.

However, if I use jekyll serve build in localhost:4000, it appears correctly.

This is my _config.yml:

markdown: kramdown
markdown_ext: markdown,mkd,mkdn,md
textile_ext: textile
highlighter: pygments

Any ideas what has been causing this error?

解决方案

UPDATED!

This is most likely due to Jekyll 3 upgrade on GitHub Pages.

From May 1st 2016 on, GitHub will not support rdiscount nor redcarpet anymore. Also, since February 1st, GitHub Pages only supports rouge:

Starting May 1st, 2016, GitHub Pages will only support kramdown, Jekyll's default Markdown engine.

GitHub Pages now only supports Rouge.

You can check this out here.

In order to deal with it, proceed as the following:

First, try as explained on this answer. Instead of #Heading you'll write # Heading.

Second, adjust your _config.yml: change highlighter and markdown for

highlighter: rouge
markdown: kramdown
kramdown:
  input: GFM

Third, to build your site locally, use Bundler, the method recommended by GitHub:

  1. Install Bundler:

    gem install bundler
    

  2. Then run bundle update - this will update all your gems, including github-pages, if you already have this gem installed locally.

  3. Then, create a Gemfile (leave it without any file extension) with the following content:

    source 'https://rubygems.org' 
    gem 'github-pages'
    

Save it to your project's root.

  1. Then, run bundle install on your project. This will create a file called Gemfile.lock and will install all required gems and their dependencies.

  2. Finally, run bundle exec jekyll serve --watch and you'll be able to view your website locally exactly as you'll view online (when hosting on GitHub).

You should be OK by then!


PS. If your project needs more gems, as jekyll-paginate or jekyll-mentions, you'll need to add them to the Gemfile, for example:

source 'https://rubygems.org' 
gem 'github-pages'
gem 'jekyll-paginate'

Also, add them to your project's _config.yml:

gems:
  - jekyll-paginate
  - jekyll-mentions

Here you'll see a list of gem versions currently supported by GitHub Pages. Here you read about Upgrading Jekyll 2 to 3.

Hope to have helped!

这篇关于Github页面无法正确显示降价的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆