Skip to content

Commit

Permalink
add instruction to use template
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard Yan committed Dec 23, 2017
1 parent 68556da commit 8424495
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ You can pass additional arguments to pandoc through `_config.yml`. The default c
pandoc:
filters:
extra:
template:
meta:
mathEngine:
```
Expand All @@ -51,6 +52,37 @@ extra:
```
passed to pandoc as `--key value`.

* `template` is a template file you wish to use when pandoc generates your posts:

``` yml
template: dir/.../template.html
```

will be passed to pandoc as `--template=dir/../template.html`

The path of the template should be relative to the root of your blog.

For example, the very simple template

``` html
$if(toc)$
<div id="$idprefix$TOC">
$toc$
</div>
$endif$
$body$
```

prepends table of contents to all your posts if variable `--toc` is also passed. To enable TOC, add to your `_config.yml`:

``` yml
pandoc:
# other options
extra:
- toc: # will be passed as `--toc`. Note the colon
template: dir/../template.html
```

* `meta` is a list of anything you wish to be sent to pandoc as meta:

```yml
Expand Down

0 comments on commit 8424495

Please sign in to comment.