2014-04-17 17:02:41 +02:00
|
|
|
# nanoc extensions
|
|
|
|
|
2017-08-12 23:08:27 +02:00
|
|
|
*[Nanoc](http://nanoc.ws/)* is a popular *static site generator*.
|
2014-04-17 17:02:41 +02:00
|
|
|
|
2017-08-12 23:08:27 +02:00
|
|
|
I'll add some little extensions for *Nanoc* here.
|
2014-04-17 17:02:41 +02:00
|
|
|
|
|
|
|
## filters
|
|
|
|
|
|
|
|
### abbreviations.rb
|
|
|
|
|
2017-08-12 23:08:27 +02:00
|
|
|
Simple *Nanoc* filter to add `<abbr>` tags.
|
2014-04-17 17:02:41 +02:00
|
|
|
|
|
|
|
After reading a YAML document from `/content/_data/abbreviations.yam`,
|
|
|
|
all occurences of each $abbrev are replaced by a
|
|
|
|
`<abbr title="$abbrev">$fulltext</abbr>` construct.
|
|
|
|
|
|
|
|
The filter currently uses a very naive - and time consuming - regexp approach.
|
|
|
|
|
|
|
|
The abbreviations dictionay in `/content/_data/abbreviations.yaml` has to
|
|
|
|
look like this:
|
|
|
|
|
|
|
|
---
|
|
|
|
abbreviations:
|
|
|
|
- abbrev: HTML
|
|
|
|
fulltext: HyperText Markup Language
|
|
|
|
|
|
|
|
You'll need a (compile and) routing rule to stop the `abbreviations.yaml`
|
|
|
|
from being rendered and compiled, i.e. like this:
|
|
|
|
|
|
|
|
# ignore everything starting with _
|
|
|
|
compile %r{/_} do
|
|
|
|
nil
|
|
|
|
end
|
|
|
|
route %r{/_} do
|
|
|
|
nil
|
|
|
|
end
|
2017-04-29 01:29:57 +02:00
|
|
|
|
|
|
|
### dejure.rb
|
|
|
|
|
2017-08-12 23:08:27 +02:00
|
|
|
*Nanoc* filter implementation of the *dejure.org*
|
2017-04-29 01:29:57 +02:00
|
|
|
[legal integration service](https://dejure.org/vernetzung.html).
|
|
|
|
|
|
|
|
filter :dejure,
|
|
|
|
format: 'weit',
|
|
|
|
buzer: 1,
|
2017-05-27 14:30:35 +02:00
|
|
|
noheadings: 0,
|
2017-04-29 01:29:57 +02:00
|
|
|
target: '_blank',
|
|
|
|
class: 'dejure'
|