Update to nanoc4.

Signed-off-by: Thomas Hochstein <thh@inter.net>
This commit is contained in:
Thomas Hochstein 2017-08-12 23:08:27 +02:00
parent f5aabcf276
commit 1746660596
3 changed files with 8 additions and 5 deletions

View file

@ -46,11 +46,13 @@ module Nanoc::Filters
CACHEDIR = 'tmp/dejure-org'
CACHEDAYS = 7
def run(input, params={})
def run(input, filterparams={})
# return input if there's nothing to replace
return input if !(/§|&sect;|Art\.|\/[0-9][0-9](?![0-9\/])| [0-9][0-9]?[\/\.][0-9][0-9](?![0-9\.])|[0-9][0-9], / =~ input)
# return input if it contains '<!-- no-dejure -->'
return input if (/<!-- ?no-?dejure ?-->/ =~ input)
# copy params (which are now immutable)
params = filterparams.dup
# set cache validity in days from params or set a default
cache_days = params.delete(:cache_days)
cache_days = CACHEDAYS if cache_days.nil?