Hey! I’m making an Jekyll (filter) Plugin that gives the md5 checksum of the content of an asset file.
I’m almost finished but I need help in rendering/processsing of the asset file. Because it may have an include or import dependency of another file.
So that in case this file (that is a dependency) get modified, the checksum hash of the main file (which is dependent of that other file) correlates with this change.
You can help me by replying in here or in stackoverflow (https://stackoverflow.com/questions/57653792/jekyll-plugin-how-to-convert-file).
Good day
UPDATE:
Here is the code (so far)
require 'digest/md5'
module Jekyll
module Bustify
def bustify(input, length=5)
file_path = File.join(File.dirname(__FILE__), '..', input).strip
file_content = File.read(file_path)
site = @context.registers[:site]
content_parsed = ...
file_hash = Digest::MD5.hexdigest content_parsed
output_hash = file_hash[-length..-1]
"#{input}?cb=#{output_hash}"
end
end
end
Liquid::Template.register_filter(Jekyll::Bustify)
UPDATE:
If you want to help me, you can contribute to this Github repository.
Thank you for your attention