Skip to content

Commit 2c008ed

Browse files
committed
fix: the excerpt of page wasn't updated (#62)
When the page was handled by processors, the page excerpt was not updated, and keep the old excerpt of the page. The solution is to update the page excerpt by checking whether the page is handled by any one of processors.
1 parent 64c6482 commit 2c008ed

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/jekyll-spaceship/cores/manager.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,20 @@ def self.is_hooked?(container, event)
5858
end
5959

6060
def self.dispatch(page, container, event)
61+
# dispatch to each processor
6162
@@_processors.each do |processor|
6263
processor.dispatch page, container, event
6364
break unless processor.next?
6465
end
6566
if event.to_s.start_with?('post') and Type.html? output_ext(page)
6667
self.dispatch_html_block(page)
6768
end
69+
# update page excerpt
70+
@@_processors.each do |processor|
71+
next if not processor.handled
72+
break page.data['excerpt'] = Jekyll::Excerpt.new(page)
73+
end
74+
# call on_handled
6875
@@_processors.each do |processor|
6976
processor.on_handled if processor.handled
7077
break unless processor.next?

0 commit comments

Comments
 (0)