Fixed issue with plugin that touched all original notes and updated their modified date unnecessarily.

This commit is contained in:
Stefan Lesser 2021-01-16 18:23:08 +00:00
parent af673fd9e7
commit 9c6b55cfff

View File

@ -10,7 +10,9 @@ JEKYLL
Jekyll::Hooks.register :site, :after_init do |site|
Dir.glob(site.collections['notes'].relative_directory + '/**/*.md').each do |filename|
raw_note_content = File.read(filename)
raw_note_content.prepend(EMPTY_FRONT_MATTER) unless raw_note_content.start_with?('---')
unless raw_note_content.start_with?('---')
raw_note_content.prepend(EMPTY_FRONT_MATTER)
File.write(filename, raw_note_content)
end
end
end