nanoc-conref-fs 0.6.2 → 0.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +5 -1
- data/lib/nanoc-conref-fs/conref-filter.rb +0 -20
- data/nanoc-conref-fs.gemspec +1 -1
- data/test/fixtures/Rules +3 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5ce3fca0efb82cce69239434123a5de9f135ad56
|
4
|
+
data.tar.gz: 421b51a89886f2354f4357f5b741b97ae3554aa0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 471d13dee8a6c72a1d3b2563f9c6e0205521c1c3ca324d906df534dde94f6af7d6275e6b15c718e21d22c8ad2ed8c7590ffe215755801e91b9fd1c05e9b56c0c
|
7
|
+
data.tar.gz: 4195c8a0227022562027eaabce6ebd078244a5dda6844a3e4719656461905ec5563e61d8c35777c55ac38f3111dd9655db1d6a5994141de8a11b7b39a9a0285c
|
data/README.md
CHANGED
@@ -25,7 +25,11 @@ data_sources:
|
|
25
25
|
- :X
|
26
26
|
```
|
27
27
|
|
28
|
-
|
28
|
+
At this point, you'll want to make a couple of changes to your *Rules* file:
|
29
|
+
|
30
|
+
* In the `preprocess` block, add a line that looks like this: `ConrefFS.apply_attributes(@config, item, :default)`. This will transform Liquid variables in frontmatter, and add the `:parents` and `:children` attributes to your items (see below).
|
31
|
+
|
32
|
+
* Add `filter :'conref-fs-filter'` to any of your `compile` Rules to have them render through the conref processor, converting Liquid variables into the actual YAML text.
|
29
33
|
|
30
34
|
**NOTE:** If you use this library with Nanoc's ERB filter, and want to use `render`, you'll need to monkey-patch an alias to avoid conflicts with Liquid:
|
31
35
|
|
@@ -1,27 +1,7 @@
|
|
1
|
-
module Nanoc
|
2
|
-
class ItemView
|
3
|
-
# allows apply_attributes to create new item attributes
|
4
|
-
def []=(key, value)
|
5
|
-
unwrap.attributes[key] = value
|
6
|
-
end
|
7
|
-
end
|
8
|
-
end
|
9
|
-
|
10
|
-
module Nanoc::HashExtensions
|
11
|
-
alias_method :original_freeze, :__nanoc_freeze_recursively
|
12
|
-
|
13
|
-
# prevents the item's frozen attributes from remaining frozen
|
14
|
-
def __nanoc_freeze_recursively
|
15
|
-
return if caller.first =~ %r{base/entities/document.rb}
|
16
|
-
original_freeze
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
1
|
class ConrefFSFilter < Nanoc::Filter
|
21
2
|
identifier :'conref-fs-filter'
|
22
3
|
|
23
4
|
def run(content, _)
|
24
|
-
ConrefFS.apply_attributes(@config, item, @rep.name)
|
25
5
|
NanocConrefFS::Conrefifier.liquify(@config, path: @item[:filename], content: content, rep: @rep.name)
|
26
6
|
end
|
27
7
|
end
|
data/nanoc-conref-fs.gemspec
CHANGED
@@ -3,7 +3,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |spec|
|
5
5
|
spec.name = 'nanoc-conref-fs'
|
6
|
-
spec.version = '0.6.
|
6
|
+
spec.version = '0.6.3'
|
7
7
|
spec.authors = ['Garen Torikian']
|
8
8
|
spec.email = ['gjtorikian@gmail.com']
|
9
9
|
spec.summary = 'A Nanoc filesystem to permit using conrefs/reusables in your content.'
|
data/test/fixtures/Rules
CHANGED