|> Enum.map(fn {shortcode, rel_file} ->
filename = Path.join(common_pack_path, rel_file)
- # If no tag matches, use the pack name as a tag
- {shortcode, filename, to_string(match_extra(@groups, filename))}
+ {shortcode, filename, [to_string(match_extra(@groups, filename))]}
end)
end
end
|> Stream.map(&String.trim/1)
|> Stream.map(fn line ->
case String.split(line, ~r/,\s*/) do
- [name, file, tags] ->
- {name, file, tags}
-
[name, file] ->
- {name, file, to_string(match_extra(@groups, file))}
+ {name, file, [to_string(match_extra(@groups, file))]}
+
+ [name, file | tags] ->
+ {name, file, tags}
_ ->
nil
tag = match_extra(@groups, Path.join("/", Path.relative_to(path, static_path)))
shortcode = Path.basename(path, Path.extname(path))
external_path = Path.join("/", Path.relative_to(path, static_path))
- {shortcode, external_path, to_string(tag)}
+ {shortcode, external_path, [to_string(tag)]}
end)
end
emoji =
Emoji.get_all()
|> Enum.map(fn {short_code, path, tags} ->
- {short_code, %{image_url: path, tags: String.split(tags, ",")}}
+ {short_code, %{image_url: path, tags: tags}}
end)
|> Enum.into(%{})