2019-03-28 09:46:30 -07:00
|
|
|
# Custom Emoji
|
2019-03-15 02:58:15 -07:00
|
|
|
|
2019-01-19 17:44:00 -08:00
|
|
|
To add custom emoji:
|
|
|
|
* Add the image file(s) to `priv/static/emoji/custom`
|
|
|
|
* In case of conflicts: add the desired shortcode with the path to `config/custom_emoji.txt`, comma-separated and one per line
|
|
|
|
* Force recompilation (``mix clean && mix compile``)
|
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
image files (in `/priv/static/emoji/custom`): `happy.png` and `sad.png`
|
|
|
|
|
|
|
|
content of `config/custom_emoji.txt`:
|
|
|
|
```
|
2019-04-01 03:17:57 -07:00
|
|
|
happy, /emoji/custom/happy.png, Tag1,Tag2
|
|
|
|
sad, /emoji/custom/sad.png, Tag1
|
|
|
|
foo, /emoji/custom/foo.png
|
2019-01-19 17:44:00 -08:00
|
|
|
```
|
|
|
|
|
|
|
|
The files should be PNG (APNG is okay with `.png` for `image/png` Content-type) and under 50kb for compatibility with mastodon.
|
2019-04-01 03:17:57 -07:00
|
|
|
|
2019-04-02 06:35:41 -07:00
|
|
|
## Emoji tags (groups)
|
2019-04-01 03:17:57 -07:00
|
|
|
|
2019-04-02 01:57:57 -07:00
|
|
|
Default tags are set in `config.exs`.
|
2019-04-02 06:32:37 -07:00
|
|
|
```elixir
|
2019-04-02 01:57:57 -07:00
|
|
|
config :pleroma, :emoji,
|
|
|
|
shortcode_globs: ["/emoji/custom/**/*.png"],
|
|
|
|
groups: [
|
|
|
|
Finmoji: "/finmoji/128px/*-128.png",
|
|
|
|
Custom: ["/emoji/*.png", "/emoji/custom/*.png"]
|
|
|
|
]
|
|
|
|
```
|
2019-04-01 03:17:57 -07:00
|
|
|
|
2019-04-02 02:13:34 -07:00
|
|
|
Order of the `groups` matters, so to override default tags just put your group on top of the list. E.g:
|
2019-04-02 06:32:37 -07:00
|
|
|
```elixir
|
2019-04-01 03:17:57 -07:00
|
|
|
config :pleroma, :emoji,
|
|
|
|
shortcode_globs: ["/emoji/custom/**/*.png"],
|
2019-04-02 01:57:57 -07:00
|
|
|
groups: [
|
|
|
|
"Finmoji special": "/finmoji/128px/a_trusted_friend-128.png", # special file
|
|
|
|
"Cirno": "/emoji/custom/cirno*.png", # png files in /emoji/custom/ which start with `cirno`
|
|
|
|
"Special group": "/emoji/custom/special_folder/*.png", # png files in /emoji/custom/special_folder/
|
|
|
|
"Another group": "/emoji/custom/special_folder/*/.png", # png files in /emoji/custom/special_folder/ subfolders
|
|
|
|
Finmoji: "/finmoji/128px/*-128.png",
|
|
|
|
Custom: ["/emoji/*.png", "/emoji/custom/*.png"]
|
|
|
|
]
|
2019-04-01 03:17:57 -07:00
|
|
|
```
|
2019-04-02 01:57:57 -07:00
|
|
|
|
2019-04-02 02:13:34 -07:00
|
|
|
Priority of tags assigns in emoji.txt and custom.txt:
|
2019-04-02 01:57:57 -07:00
|
|
|
|
|
|
|
`tag in file > special group setting in config.exs > default setting in config.exs`
|
|
|
|
|
|
|
|
Priority for globs:
|
|
|
|
|
|
|
|
`special group setting in config.exs > default setting in config.exs`
|