nanoc-conref-fs 0.6.2 → 0.6.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2d01c92aa582b947c2845c60898017b6ef47c30e
4
- data.tar.gz: 2ecb11916d271d8ee34291c028dcd3bf7937fc38
3
+ metadata.gz: 5ce3fca0efb82cce69239434123a5de9f135ad56
4
+ data.tar.gz: 421b51a89886f2354f4357f5b741b97ae3554aa0
5
5
  SHA512:
6
- metadata.gz: bdd96dbbb9abb7498a45cbc4821fb0690f648ac85c565ff5335c5bb046853cef50975631fc261bf39e941bc2b69bf8e9a02fa4c997347480e6d6125bed582596
7
- data.tar.gz: 289b1f20ed550fbad9fd8b9a0536714252a99e5f1ef6eb85857c9163f4c6d6d6b0f6ac06039f9cfa1a84fa1973655ba66944183a36d9aa455f5e55e9e3fb7b37
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
- You can add `filter :'conref-fs-filter'` to any of your `compile` Rules to then have them renderer through the conref processor.
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
@@ -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.2'
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
@@ -1,6 +1,9 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  preprocess do
4
+ @items.each do |item|
5
+ ConrefFS.apply_attributes(@config, item, :default)
6
+ end
4
7
  end
5
8
 
6
9
  ignore '/**/*.html'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nanoc-conref-fs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Garen Torikian