4

Jekyll 文档声明代码高亮是使用 Liquid 标签完成的,如下所示:

{% highlight ruby %}
def show
  @widget = Widget(params[:id])
  respond_to do |format|
    format.html # show.html.erb
    format.json { render json: @widget }
  end
end
{% endhighlight %}

但是,我宁愿使用 Markdown 语法:

```ruby
def foo
  puts 'foo'
end
```

我自己尝试了以下方式:

``` ini
; Disables the splash screen, if it has been compiled into the launcher.
RunLocally=true
```

但是,结果看起来并不像它应该的那样。

在此处输入图像描述

4

1 回答 1

10

我必须将以下内容添加到我的 _config.yml 以使我的 GitHub Pages 语法突出显示工作:

markdown: redcarpet
extensions: [fenced_code_blocks]

我不知道为什么fenced_code_blocks需要 GitHub Pages,因为它应该在 Jekyll 中默认启用。

于 2014-01-14T03:31:14.477 回答