Version assets

This commit is contained in:
2023-05-15 19:42:56 +10:00
parent 0a790e83a1
commit 4309453f51
10 changed files with 2418 additions and 8 deletions

View File

@@ -5,10 +5,22 @@ module Adamantium
super(**options)
end
def asset_from_manifest(filename)
return "/assets/#{filename}" if Hanami.env != :production
hashed_filename = asset_manifest[filename]
"/assets/dist/#{hashed_filename}"
end
def link_active? path
# TODO: waiting for Hanami View to be released
# to access current_path
false
end
private
def asset_manifest
@asset_manifest ||= JSON.parse(File.read("public/assets/asset-manifest.json"))
end
end
end