From 9727a1a4d1e72f20931ae0fda2763d8c10d200eb Mon Sep 17 00:00:00 2001 From: Garry Ing Date: Sat, 24 Apr 2021 21:22:29 -0400 Subject: [PATCH] move hook event --- _plugins/empty_front_matter_note_injector.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_plugins/empty_front_matter_note_injector.rb b/_plugins/empty_front_matter_note_injector.rb index 569679b..175ea00 100644 --- a/_plugins/empty_front_matter_note_injector.rb +++ b/_plugins/empty_front_matter_note_injector.rb @@ -5,12 +5,12 @@ front_matter_date = DateTime.now.strftime('%Y-%m-%d') EMPTY_FRONT_MATTER = <<~JEKYLL --- date: #{front_matter_date} + status: 🌱 --- - JEKYLL # Inject empty front matter in notes that don't have any -Jekyll::Hooks.register :site, :after_init do |site| +Jekyll::Hooks.register :site, :post_read do |site| Dir.glob("#{site.collections['notes'].relative_directory}/**/*.md").each do |filename| raw_note_content = File.read(filename) unless raw_note_content.start_with?('---')