mirror of
https://github.com/jekyll/jekyll.git
synced 2026-04-28 03:01:03 -04:00
Compare commits
4 Commits
4.0-stable
...
docs-40
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1898ced3c4 | ||
|
|
5d924f6216 | ||
|
|
2a6ec9788b | ||
|
|
1d8d6be243 |
@@ -689,11 +689,6 @@ liquid:
|
||||
strict_variables: false
|
||||
|
||||
# Markdown Processors
|
||||
rdiscount:
|
||||
extensions: []
|
||||
|
||||
redcarpet:
|
||||
extensions: []
|
||||
|
||||
kramdown:
|
||||
auto_ids: true
|
||||
@@ -728,50 +723,6 @@ mutually exclusive.
|
||||
The various Markdown renderers supported by Jekyll sometimes have extra options
|
||||
available.
|
||||
|
||||
### Redcarpet
|
||||
|
||||
Redcarpet can be configured by providing an `extensions` sub-setting, whose
|
||||
value should be an array of strings. Each string should be the name of one of
|
||||
the `Redcarpet::Markdown` class's extensions; if present in the array, it will
|
||||
set the corresponding extension to `true`.
|
||||
|
||||
Jekyll handles two special Redcarpet extensions:
|
||||
|
||||
- `no_fenced_code_blocks` --- By default, Jekyll sets the `fenced_code_blocks`
|
||||
extension (for delimiting code blocks with triple tildes or triple backticks)
|
||||
to `true`, probably because GitHub's eager adoption of them is starting to make
|
||||
them inescapable. Redcarpet's normal `fenced_code_blocks` extension is inert
|
||||
when used with Jekyll; instead, you can use this inverted version of the
|
||||
extension for disabling fenced code.
|
||||
|
||||
Note that you can also specify a language for highlighting after the first
|
||||
delimiter:
|
||||
|
||||
```ruby
|
||||
# ...ruby code
|
||||
```
|
||||
|
||||
With both fenced code blocks and highlighter enabled, this will statically
|
||||
highlight the code; without any syntax highlighter, it will add a
|
||||
`class="LANGUAGE"` attribute to the `<code>` element, which can be used as a
|
||||
hint by various JavaScript code highlighting libraries.
|
||||
|
||||
- `smart` --- This pseudo-extension turns on SmartyPants, which converts
|
||||
straight quotes to curly quotes and runs of hyphens to em (`---`) and en (`--`) dashes.
|
||||
|
||||
All other extensions retain their usual names from Redcarpet, and no renderer
|
||||
options aside from `smart` can be specified in Jekyll. [A list of available
|
||||
extensions can be found in the Redcarpet README file.][redcarpet_extensions]
|
||||
Make sure you're looking at the README for the right version of
|
||||
Redcarpet: Jekyll currently uses v3.2.x. The most commonly used
|
||||
extensions are:
|
||||
|
||||
- `tables`
|
||||
- `no_intra_emphasis`
|
||||
- `autolink`
|
||||
|
||||
[redcarpet_extensions]: https://github.com/vmg/redcarpet/blob/v3.2.2/README.markdown#and-its-like-really-simple-to-use
|
||||
|
||||
### Custom Markdown Processors
|
||||
|
||||
If you're interested in creating a custom markdown processor, you're in luck! Create a new class in the `Jekyll::Converters::Markdown` namespace:
|
||||
|
||||
@@ -588,6 +588,23 @@ One major benefit of using the `link` or `post_url` tag is link validation. If t
|
||||
|
||||
Note you cannot add filters to `link` tags. For example, you cannot append a string using Liquid filters, such as `{% raw %}{% link mypage.html | append: "#section1" %} {% endraw %}`. To link to sections on a page, you will need to use regular HTML or Markdown linking techniques.
|
||||
|
||||
The name of the file you want to link can be specified as a variable instead of an actual file name. For example, suppose you defined a variable in your page's front matter like this:
|
||||
|
||||
```yaml
|
||||
---
|
||||
title: My page
|
||||
my_variable: footer_company_a.html
|
||||
---
|
||||
```
|
||||
|
||||
You could then reference that variable in your link:
|
||||
|
||||
```liquid
|
||||
{% raw %}{% link {{ page.my_variable }} %}{% endraw %}
|
||||
```
|
||||
|
||||
In this example, the link would add link to the file `footer_company_a.html`.
|
||||
|
||||
### Linking to posts
|
||||
|
||||
If you want to include a link to a post on your site, the `post_url` tag will generate the correct permalink URL for the post you specify.
|
||||
|
||||
Reference in New Issue
Block a user