jekyll-is-hookdown 0.8.0.4 → 0.8.0.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: da37ba1fb35409ea8c632c8b1febf8817e2661ceab9274ba2bef23c020147826
4
- data.tar.gz: 868079cadc51e00b6d19bedcbc0df7bf1640201259e0117300b5c09e199dd921
3
+ metadata.gz: 87b9cb1f0ca5eb1bc498487c55691e7133387aea3c571f5347081f56edf87367
4
+ data.tar.gz: 3a6d1f962ad0d4fdfd8dc5d91184e48471b02e23262fe6269e107a17463fc049
5
5
  SHA512:
6
- metadata.gz: b2c250e14593802d2c3af5cd6d930e565887f59cbd5d19bf2e99e7f50e6ffaa402089053cf1dda892ec04723509192146da477294cd96e16c5ca71aba40e5cd8
7
- data.tar.gz: 6fa6ba530ea69d14144718491864d6a995ca0c3835c543c8e2b45b32a2b125943fb3f2ce84dbcef17ab257b52cea33bdf36b43c6d5a6bb9a551e16a33e49d89a
6
+ metadata.gz: b5274949a9a9c9de234af8dd310905717b19fcbc63c4ed230d3c2d69cac4b79d9b8a9380f90c011e5f9599c3e47417ac06c0672a1a83da3f8e2fc74af9f45e30
7
+ data.tar.gz: 67b7b329bee0303da0ccc3d2410676e47cb02a032c72b47ac3fce7c5f258231c619e37848d6885abcc84072a82ae0b21e90c4e0b072ac185ae54e94c653061a3
data/README-ru.md ADDED
@@ -0,0 +1,144 @@
1
+ | [en](README.md) | RU |
2
+ |----------|----------|
3
+
4
+ # jekyll-is-hookdown
5
+
6
+ [![GitHub License](https://img.shields.io/github/license/jekyll-is/jekyll-is-hookdown)](LICENSE)
7
+ [![Gem Version](https://badge.fury.io/rb/jekyll-is-hookdown.svg?icon=si%3Arubygems)](https://badge.fury.io/rb/jekyll-is-hookdown)
8
+ [![Ruby](https://github.com/jekyll-is/jekyll-is-hookdown/actions/workflows/ruby.yml/badge.svg)](https://github.com/jekyll-is/jekyll-is-hookdown/actions/workflows/ruby.yml)
9
+ ![Coverage](coverage-badge.svg)
10
+
11
+ Плагин для Jekyll, позволяющий подменить markdown-парсер на кастомный — унаследованный от стандартного Kramdown и дополняющий его
12
+ дополнительным хуком для перехвата внутреннего AST-представления.
13
+
14
+ ## Подключение
15
+
16
+ Вообще, гем предназначен для использования другими плагинами и должен быть указан в зависимостях именно в них, а не в `Gemfile` сайта.
17
+ Однако, в Jekyll есть возможность писать плагины в подкаталоге `_plugins` — чтобы там использовать данный хук, потребуется подключить
18
+ данный гем именно как плагин:
19
+
20
+ В `Gemfile`:
21
+
22
+ ```ruby
23
+ group :jekyll_plugins do
24
+ . . .
25
+ gem 'jekyll-is-hookdown', '~> 0.8'
26
+ end
27
+ ```
28
+
29
+ Или, если вы не используете Bundler, установить гем командой:
30
+
31
+ ```shell
32
+ gem install jekyll-is-hookdown
33
+ ```
34
+
35
+ В `_config.yml`:
36
+
37
+ ```yaml
38
+ plugins:
39
+ . . .
40
+ - jekyll-is-hookdown
41
+
42
+ markdown: Hookdown
43
+ ```
44
+
45
+ Последняя строчка включает работу плагина. При этом, поскольку конвертер унаследован от стандартного Kramdown, будут работать все расширения
46
+ и настройки в подразделе конфигурации `kramdown` (собственной секции `hookdown` плагин не предусматривает), например:
47
+
48
+ ```yaml
49
+ kramdown:
50
+ input: GFM
51
+ hard_wrap: false
52
+ ```
53
+
54
+ ### Зависимости
55
+
56
+ + Ruby >= 3.4
57
+
58
+ + Jekyll ~> 4.4
59
+
60
+ + Kramdown ~> 2.5
61
+
62
+ ## Использование
63
+
64
+ Основной хук внедрен в [общую систему хуков Jekyll](https://jekyllrb.com/docs/plugins/hooks/) как событие `:post_parse`. Он доступен
65
+ для объектов `:pages`, `:documents` и `:posts` (нужно
66
+ заметить, что `:documents` _включает в себя_ `:posts`). В обработчик передается объект документа/страницы и объект
67
+ класса [`Kramdown::Document`](https://kramdown.gettalong.org/rdoc/Kramdown/Document.html).
68
+
69
+ ```ruby
70
+ Jekyll::Hooks::register [ :pages, :documents ], :post_parse do |page, document|
71
+ # Какие-то действия с документом...
72
+ end
73
+ ```
74
+
75
+ Поскольку чаще всего нужно обрабатывать не весь документ, а определенные теги/элементы, предусмотрен и другой хук, не приводимый к стандартным,
76
+ он регистрируется иначе. В обработчик передается объект документа/страницы и объект
77
+ класса [`Kramdown::Element`](https://kramdown.gettalong.org/rdoc/Kramdown/Element.html).
78
+
79
+ ```ruby
80
+ JekyllIS::Hookdown::register_element_hook [ :pages, :documents ], :a, :img do |page, element|
81
+ case element.type
82
+ when :a
83
+ # Тут что-то делаем...
84
+ when :img
85
+ # И тут что-то делаем...
86
+ end
87
+ end
88
+ ```
89
+
90
+ При этом значение, возвращаемое обработчиком, важно и трактуется следующим образом:
91
+
92
+ + `nil` — не приводит к дополнительным действиям.
93
+
94
+ + `Kramdown::Element` — заменяет текущий элемент в AST-дереве.
95
+
96
+ + `:delete` — удаляет текущий элемент из AST-дерева.
97
+
98
+ + Прочие значения трактуются как ошибочные.
99
+
100
+ _Замена и удаление корневого элемента (`document.root`) не поддерживается._
101
+
102
+ ### Рекомендация
103
+
104
+ Если вы пишете свой плагин с использованием этого хука, крайне желательно убедиться, что он активирован, то есть в конфиге выбран соответствующий
105
+ кастомный конвертер. Можно, конечно, непосредственно проверять значение в `_config.yml`, но лучше использовать специальный метод:
106
+
107
+ ```ruby
108
+ if JekyllIS::Hookdown::enabled?
109
+ # Устанавливаем свои хуки здесь...
110
+ end
111
+ ```
112
+
113
+ Проверка этого условия будет работать даже _до_ инициализации сайта.
114
+
115
+ ### Пример
116
+
117
+ Выставим всем внешним ссылкам `target="_blank"`:
118
+
119
+ ```ruby
120
+ if JekyllIS::Hookdown::enabled?
121
+ JekyllIS::Hookdown::register_element_hook [ :pages, :documents ], :a do |_, element|
122
+ href = element.attr['href']
123
+ target = element.attr['target']
124
+ if href && !target && (href.start_with?('https://') || href.start_with?('http://'))
125
+ element.attr['target'] = '_blank'
126
+ end
127
+ nil
128
+ end
129
+ end
130
+ ```
131
+
132
+ ## Лицензия
133
+
134
+ Плагин опубликован под **[GNU Lesser General Public License v3.0](https://www.gnu.org/licenses/lgpl-3.0.html)**. Это означает, что вы можете свободно
135
+ им пользоваться без каких-то ограничений, пока подтягиваете его по зависимостям. Если же вы захотите _взять код_ и втянуть его в свой проект,
136
+ или выпустить _форк_ данного плагина, результат должен быть опубликован так же под LGPLv3.
137
+
138
+ ## Статус
139
+
140
+ Текущая версия — **0.8.x**. Это следует трактовать как публичную альфа-версию.
141
+
142
+ Однако, в силу принципиального ограничения функциональности — плагин чисто инфраструктурный и не должен делать ничего лишнего, скорее всего чего-то
143
+ нового в нем уже не появится. Так что по мере доработки автотестов и документации он будет плавно переходить в стадию бета-версии (0.9.x) и затем
144
+ релиза (1.0) без каких-либо сущностных изменений в коде.
data/README.md CHANGED
@@ -1,3 +1,131 @@
1
+ | **EN** | [ru](README-ru.md) |
2
+ |----------|----------|
3
+
1
4
  # jekyll-is-hookdown
2
5
 
3
- Hooked Kramdown for Jekyll
6
+ [![GitHub License](https://img.shields.io/github/license/jekyll-is/jekyll-is-hookdown)](LICENSE)
7
+ [![Gem Version](https://badge.fury.io/rb/jekyll-is-hookdown.svg?icon=si%3Arubygems)](https://badge.fury.io/rb/jekyll-is-hookdown)
8
+ [![Ruby](https://github.com/jekyll-is/jekyll-is-hookdown/actions/workflows/ruby.yml/badge.svg)](https://github.com/jekyll-is/jekyll-is-hookdown/actions/workflows/ruby.yml)
9
+ ![Coverage](coverage-badge.svg)
10
+
11
+ A Jekyll plugin that replaces the default Markdown parser with a custom one — inheriting from the standard Kramdown and extending it with an additional hook for intercepting the internal AST representation.
12
+
13
+ ## Setup
14
+
15
+ In general, this gem is intended to be used by other plugins and should be listed as a dependency in *their* gemspecs, not in the site's `Gemfile`.
16
+ However, Jekyll allows writing plugins in the `_plugins` subdirectory — to use this hook there, you will need to include the gem as a plugin:
17
+
18
+ In `Gemfile`:
19
+
20
+ ```ruby
21
+ group :jekyll_plugins do
22
+ . . .
23
+ gem 'jekyll-is-hookdown', '~> 0.8'
24
+ end
25
+ ```
26
+
27
+ Or, if you are not using Bundler, install the gem manually:
28
+
29
+ ```shell
30
+ gem install jekyll-is-hookdown
31
+ ```
32
+
33
+ In `_config.yml`:
34
+
35
+ ```yaml
36
+ plugins:
37
+ . . .
38
+ - jekyll-is-hookdown
39
+
40
+ markdown: Hookdown
41
+ ```
42
+
43
+ The last line activates the plugin. Since the converter inherits from the standard Kramdown parser, all extensions and settings in the `kramdown` configuration subsection will continue to work (the plugin does not define its own `hookdown` section), for example:
44
+
45
+ ```yaml
46
+ kramdown:
47
+ input: GFM
48
+ hard_wrap: false
49
+ ```
50
+
51
+ ### Dependencies
52
+
53
+ + Ruby >= 3.4
54
+
55
+ + Jekyll ~> 4.4
56
+
57
+ + Kramdown ~> 2.5
58
+
59
+ ## Usage
60
+
61
+ The main hook is injected into the [standard Jekyll hook system](https://jekyllrb.com/docs/plugins/hooks/) as the `:post_parse` event. It is available for `:pages`, `:documents`, and `:posts` (note that `:documents` *includes* `:posts`). The handler receives the page/document object and a [`Kramdown::Document`](https://kramdown.gettalong.org/rdoc/Kramdown/Document.html) instance.
62
+
63
+ ```ruby
64
+ Jekyll::Hooks::register [ :pages, :documents ], :post_parse do |page, document|
65
+ # Do something with the document...
66
+ end
67
+ ```
68
+
69
+ Since in most cases you want to process specific tags/elements rather than the entire document, an additional hook is provided. It is *not* mapped to the standard Jekyll hook system and is registered differently. The handler receives the page/document object and a [`Kramdown::Element`](https://kramdown.gettalong.org/rdoc/Kramdown/Element.html) instance.
70
+
71
+ ```ruby
72
+ JekyllIS::Hookdown::register_element_hook [ :pages, :documents ], :a, :img do |page, element|
73
+ case element.type
74
+ when :a
75
+ # Do something here...
76
+ when :img
77
+ # And something here...
78
+ end
79
+ end
80
+ ```
81
+
82
+ The return value of the handler is significant and interpreted as follows:
83
+
84
+ + `nil` — no additional action is taken.
85
+
86
+ + `Kramdown::Element` — replaces the current element in the AST tree.
87
+
88
+ + `:delete` — removes the current element from the AST tree.
89
+
90
+ + Any other value is treated as an error.
91
+
92
+ _Replacing or deleting the root element (`document.root`) is not supported._
93
+
94
+ ### Recommendation
95
+
96
+ If you are writing your own plugin that uses this hook, it is highly recommended to verify that it is active, i.e. that the corresponding custom converter is selected in the config. You could check the value in `_config.yml` directly, but it is better to use the dedicated method:
97
+
98
+ ```ruby
99
+ if JekyllIS::Hookdown::enabled?
100
+ # Register your hooks here...
101
+ end
102
+ ```
103
+
104
+ This check will work even *before* the site is initialized.
105
+
106
+ ### Example
107
+
108
+ Add `target="_blank"` to all external links:
109
+
110
+ ```ruby
111
+ if JekyllIS::Hookdown::enabled?
112
+ JekyllIS::Hookdown::register_element_hook [ :pages, :documents ], :a do |_, element|
113
+ href = element.attr['href']
114
+ target = element.attr['target']
115
+ if href && !target && (href.start_with?('https://') || href.start_with?('http://'))
116
+ element.attr['target'] = '_blank'
117
+ end
118
+ nil
119
+ end
120
+ end
121
+ ```
122
+
123
+ ## License
124
+
125
+ The plugin is released under the **[GNU Lesser General Public License v3.0](https://www.gnu.org/licenses/lgpl-3.0.html)**. This means you are free to use it without any restrictions as long as you pull it in as a dependency. If you wish to *take the code* and incorporate it into your own project, or release a *fork* of this plugin, the result must also be published under the LGPLv3.
126
+
127
+ ## Status
128
+
129
+ The current version is **0.8.x**. This should be treated as a public alpha release.
130
+
131
+ However, due to the deliberately limited scope — the plugin is purely infrastructural and should not do anything extra — it is unlikely that any significant new features will be added. As tests and documentation are refined, it will gradually move to beta (0.9.x) and then to a stable release (1.0) without any substantial code changes.
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0"?><svg xmlns="http://www.w3.org/2000/svg" width="100" height="20">
2
+ <rect width="100" height="20" fill="#555"/>
3
+ <rect x="63" width="37" height="20" fill="#c6bc3d"/>
4
+ <text x="8" y="14" fill="#fff" font-family="Verdana" font-size="11">coverage</text>
5
+ <text x="66" y="14" fill="#fff" font-family="Verdana" font-size="11">84%</text>
6
+ </svg>
@@ -2,10 +2,13 @@
2
2
 
3
3
  require 'jekyll'
4
4
 
5
- require_relative 'jekyll_patch'
5
+ require_relative 'setup'
6
6
 
7
+ # @private
7
8
  class Jekyll::Converters::Markdown::Hookdown < Jekyll::Converters::Markdown::KramdownParser
8
9
 
10
+ # @param [String] content
11
+ # @return [String]
9
12
  def convert content
10
13
  document = Kramdown::JekyllDocument.new content, @config
11
14
  page = JekyllIS::Hookdown::current_page
@@ -3,12 +3,20 @@
3
3
  require 'set'
4
4
  require 'kramdown'
5
5
 
6
- require_relative 'jekyll_patch'
6
+ require_relative 'setup'
7
7
 
8
8
  module JekyllIS::Hookdown
9
9
 
10
10
  class << self
11
11
 
12
+ # @param [Symbol, Array<Symbol>] owner
13
+ # @param [Array<Symbol>] elements
14
+ # @param [Integer, Symbol] priority
15
+ # @return [Proc, nil]
16
+ # @yield Hook block
17
+ # @yieldparam [Jekyll::Page, Jekyll::Document] page
18
+ # @yieldparam [Kramdown::Element] element
19
+ # @yieldreturn [nil, Kramdown::Element, :delete]
12
20
  def register_element_hook owner, *elements, priority: Jekyll::Hooks::DEFAULT_PRIORITY, &block
13
21
  if enabled?
14
22
  priority = Jekyll::Hooks::priority_value(priority)
@@ -23,14 +31,17 @@ module JekyllIS::Hookdown
23
31
  end
24
32
  block
25
33
  else
26
- false
34
+ nil
27
35
  end
28
36
  end
29
37
 
38
+ # @param [Proc] block
39
+ # @return [void]
30
40
  def unregister_element_hook block
31
41
  if @hooks
32
42
  @hooks.reject! { it[:block] == block }
33
43
  end
44
+ nil
34
45
  end
35
46
 
36
47
  private
@@ -7,7 +7,7 @@ module JekyllIS::Hookdown; end
7
7
  module JekyllIS::Hookdown::Info
8
8
 
9
9
  NAME = 'jekyll-is-hookdown'
10
- VERSION = '0.8.0.4'
10
+ VERSION = '0.8.0.6'
11
11
  SUMMARY = 'Hooked Kramdown for Jekyll'
12
12
  LICENSE = 'LGPL-3.0-or-later'
13
13
  AUTHOR = 'Ivan Shikhalev'
@@ -0,0 +1,60 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'jekyll'
4
+
5
+ require_relative 'info'
6
+
7
+ module JekyllIS::Hookdown
8
+
9
+ class << self
10
+
11
+ # @return [Jekyll::Page or Jekyll::Document]
12
+ def current_page
13
+ Thread::current[:hookdown_current_page]
14
+ end
15
+
16
+ # @param [Jekyll::Site, nil] site
17
+ def enabled? site = nil
18
+ @site ||= site
19
+ @enabled ||= setup
20
+ end
21
+
22
+ private
23
+
24
+ def setup
25
+ enabled = if @site
26
+ @site.config['markdown'] == 'Hookdown'
27
+ else
28
+ # Fallback
29
+ Jekyll::configuration['markdown'] == 'Hookdown'
30
+ end
31
+ if enabled
32
+ registry = Jekyll::Hooks.instance_variable_get :@registry
33
+ [ :pages, :posts, :documents ].each do |owner|
34
+ registry[owner][:post_parse] ||= [] if registry[owner]
35
+ end
36
+ Jekyll::Hooks::register [ :pages, :documents ], :pre_render do |page|
37
+ Thread::current[:hookdown_current_page] = page
38
+ end
39
+ Jekyll::Hooks::register [ :pages, :documents ], :post_render do |page|
40
+ if Thread::current[:hookdown_current_page] == page
41
+ Thread::current[:hookdown_current_page] = nil
42
+ else
43
+ Jekyll::logger.warn JekyllIS::Hookdown::Info::NAME, "Mismatch pages: #{ page.inspect } vs #{ Thread::current[:hookdown_current_page].inspect }"
44
+ end
45
+ end
46
+ end
47
+ enabled
48
+ end
49
+
50
+ end
51
+
52
+ end
53
+
54
+ Jekyll::Hooks::register :site, :after_init, priority: 50 do |site|
55
+ if JekyllIS::Hookdown::enabled?(site)
56
+ Jekyll::logger.info JekyllIS::Hookdown::Info::NAME, 'JekyllIS::Hookdown enabled.'
57
+ else
58
+ Jekyll::logger.warn JekyllIS::Hookdown::Info::NAME, 'JekyllIS::Hookdown disabled.'
59
+ end
60
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative 'hookdown/jekyll_patch'
3
+ require_relative 'hookdown/setup'
4
4
  require_relative 'hookdown/converter'
5
5
  require_relative 'hookdown/extra'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-is-hookdown
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0.4
4
+ version: 0.8.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ivan Shikhalev
@@ -79,6 +79,76 @@ dependencies:
79
79
  - - "~>"
80
80
  - !ruby/object:Gem::Version
81
81
  version: '1.1'
82
+ - !ruby/object:Gem::Dependency
83
+ name: is-module-reset
84
+ requirement: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - "~>"
87
+ - !ruby/object:Gem::Version
88
+ version: '0.8'
89
+ type: :development
90
+ prerelease: false
91
+ version_requirements: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - "~>"
94
+ - !ruby/object:Gem::Version
95
+ version: '0.8'
96
+ - !ruby/object:Gem::Dependency
97
+ name: yard
98
+ requirement: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - ">="
101
+ - !ruby/object:Gem::Version
102
+ version: '0'
103
+ type: :development
104
+ prerelease: false
105
+ version_requirements: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - ">="
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
110
+ - !ruby/object:Gem::Dependency
111
+ name: redcarpet
112
+ requirement: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - ">="
115
+ - !ruby/object:Gem::Version
116
+ version: '0'
117
+ type: :development
118
+ prerelease: false
119
+ version_requirements: !ruby/object:Gem::Requirement
120
+ requirements:
121
+ - - ">="
122
+ - !ruby/object:Gem::Version
123
+ version: '0'
124
+ - !ruby/object:Gem::Dependency
125
+ name: rdoc
126
+ requirement: !ruby/object:Gem::Requirement
127
+ requirements:
128
+ - - ">="
129
+ - !ruby/object:Gem::Version
130
+ version: '0'
131
+ type: :development
132
+ prerelease: false
133
+ version_requirements: !ruby/object:Gem::Requirement
134
+ requirements:
135
+ - - ">="
136
+ - !ruby/object:Gem::Version
137
+ version: '0'
138
+ - !ruby/object:Gem::Dependency
139
+ name: yard-markdown-relative-links
140
+ requirement: !ruby/object:Gem::Requirement
141
+ requirements:
142
+ - - ">="
143
+ - !ruby/object:Gem::Version
144
+ version: '0'
145
+ type: :development
146
+ prerelease: false
147
+ version_requirements: !ruby/object:Gem::Requirement
148
+ requirements:
149
+ - - ">="
150
+ - !ruby/object:Gem::Version
151
+ version: '0'
82
152
  description: Hooked Kramdown for Jekyll.
83
153
  email:
84
154
  - shikhalev@gmail.com
@@ -87,13 +157,15 @@ extensions: []
87
157
  extra_rdoc_files: []
88
158
  files:
89
159
  - LICENSE
160
+ - README-ru.md
90
161
  - README.md
162
+ - coverage-badge.svg
91
163
  - lib/jekyll-is-hookdown.rb
92
164
  - lib/jekyll-is/hookdown.rb
93
165
  - lib/jekyll-is/hookdown/converter.rb
94
166
  - lib/jekyll-is/hookdown/extra.rb
95
167
  - lib/jekyll-is/hookdown/info.rb
96
- - lib/jekyll-is/hookdown/jekyll_patch.rb
168
+ - lib/jekyll-is/hookdown/setup.rb
97
169
  homepage: https://github.com/jekyll-is/jekyll-is-hookdown
98
170
  licenses:
99
171
  - LGPL-3.0-or-later
@@ -1,50 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'jekyll'
4
-
5
- require_relative 'info'
6
-
7
- module JekyllIS::Hookdown
8
-
9
- class << self
10
-
11
- def apply_patch
12
- registry = Jekyll::Hooks.instance_variable_get :@registry
13
- [ :pages, :posts, :documents ].each do |owner|
14
- registry[owner][:post_parse] ||= [] if registry[owner]
15
- end
16
- end
17
-
18
- def current_page
19
- Thread::current[:hookdown_current_page]
20
- end
21
-
22
- def current_page= value
23
- Thread::current[:hookdown_current_page] = value
24
- end
25
-
26
- def enabled?
27
- Jekyll::configuration['markdown'] == 'Hookdown'
28
- end
29
-
30
- end
31
-
32
- end
33
-
34
- if JekyllIS::Hookdown::enabled?
35
-
36
- JekyllIS::Hookdown::apply_patch
37
-
38
- Jekyll::Hooks::register [ :pages, :documents ], :pre_render do |page|
39
- JekyllIS::Hookdown::current_page = page
40
- end
41
-
42
- Jekyll::Hooks::register [ :pages, :documents ], :post_render do |page|
43
- if JekyllIS::Hookdown::current_page == page
44
- JekyllIS::Hookdown::current_page = nil
45
- else
46
- Jekyll::logger.warn JekyllIS::Hookdown::Info::NAME, "Mismatch pages: #{ page.inspect } vs #{ JekyllIS::Hookdown::current_page.inspect }"
47
- end
48
- end
49
-
50
- end