Return to generating the icons from the filesystem
This commit is contained in:
12
lib/heroicons/icon_cache.ex
Normal file
12
lib/heroicons/icon_cache.ex
Normal file
@ -0,0 +1,12 @@
|
||||
defmodule Heroicons.IconCache do
|
||||
|
||||
@doc "Get's an icon's body from the filesystem"
|
||||
# TODO implement ETS-based caching & benchmark
|
||||
def icon_body(path) do
|
||||
icon = File.read!(path)
|
||||
|
||||
<<"<svg ", body::binary>> = icon
|
||||
|
||||
body
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user