Make emoji configurable in files.
This commit is contained in:
parent
959e993c7d
commit
7c82b82197
5 changed files with 28 additions and 2 deletions
|
|
@ -93,7 +93,19 @@ defmodule Pleroma.Formatter do
|
|||
{finmoji, "/finmoji/128px/#{finmoji}-128.png"}
|
||||
end)
|
||||
|
||||
@emoji @finmoji_with_filenames
|
||||
@emoji_from_file (with {:ok, file} <- File.read("config/emoji.txt") do
|
||||
file
|
||||
|> String.trim
|
||||
|> String.split("\n")
|
||||
|> Enum.map(fn(line) ->
|
||||
[name, file] = String.split(line, ", ")
|
||||
{name, file}
|
||||
end)
|
||||
else
|
||||
_ -> []
|
||||
end)
|
||||
|
||||
@emoji @finmoji_with_filenames ++ @emoji_from_file
|
||||
|
||||
def emojify(text, additional \\ nil) do
|
||||
all_emoji = if additional do
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ defmodule Pleroma.Web.Endpoint do
|
|||
at: "/media", from: "uploads", gzip: false
|
||||
plug Plug.Static,
|
||||
at: "/", from: :pleroma,
|
||||
only: ~w(index.html static finmoji)
|
||||
only: ~w(index.html static finmoji emoji)
|
||||
|
||||
# Code reloading can be explicitly enabled under the
|
||||
# :code_reloader configuration of your endpoint.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue