Initial commit

This commit is contained in:
Łukasz Skotarek 2023-01-05 19:02:49 +01:00 committed by GitHub
commit fa52922077
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
39 changed files with 1802 additions and 0 deletions

View file

@ -0,0 +1,18 @@
# frozen_string_literal: true
EMPTY_FRONT_MATTER = <<~JEKYLL
---
---
JEKYLL
# Inject empty front matter in notes that don't have any
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)
unless raw_note_content.start_with?('---')
raw_note_content.prepend(EMPTY_FRONT_MATTER)
File.write(filename, raw_note_content)
end
end
end