Merge branch 'hotfix/fix_undefined_summary' into 'develop'
[akkoma] / docs / config / custom_emoji.md
1 # Custom Emoji
2
3 To add custom emoji:
4 * Add the image file(s) to `priv/static/emoji/custom`
5 * In case of conflicts: add the desired shortcode with the path to `config/custom_emoji.txt`, comma-separated and one per line
6 * Force recompilation (``mix clean && mix compile``)
7
8 Example:
9
10 image files (in `/priv/static/emoji/custom`): `happy.png` and `sad.png`
11
12 content of `config/custom_emoji.txt`:
13 ```
14 happy, /emoji/custom/happy.png, Tag1,Tag2
15 sad, /emoji/custom/sad.png, Tag1
16 foo, /emoji/custom/foo.png
17 ```
18
19 The files should be PNG (APNG is okay with `.png` for `image/png` Content-type) and under 50kb for compatibility with mastodon.
20
21 ## Emoji tags (groups)
22
23 Default tags are set in `config.exs`.
24 ```elixir
25 config :pleroma, :emoji,
26 shortcode_globs: ["/emoji/custom/**/*.png"],
27 groups: [
28 Finmoji: "/finmoji/128px/*-128.png",
29 Custom: ["/emoji/*.png", "/emoji/custom/*.png"]
30 ]
31 ```
32
33 Order of the `groups` matters, so to override default tags just put your group on top of the list. E.g:
34 ```elixir
35 config :pleroma, :emoji,
36 shortcode_globs: ["/emoji/custom/**/*.png"],
37 groups: [
38 "Finmoji special": "/finmoji/128px/a_trusted_friend-128.png", # special file
39 "Cirno": "/emoji/custom/cirno*.png", # png files in /emoji/custom/ which start with `cirno`
40 "Special group": "/emoji/custom/special_folder/*.png", # png files in /emoji/custom/special_folder/
41 "Another group": "/emoji/custom/special_folder/*/.png", # png files in /emoji/custom/special_folder/ subfolders
42 Finmoji: "/finmoji/128px/*-128.png",
43 Custom: ["/emoji/*.png", "/emoji/custom/*.png"]
44 ]
45 ```
46
47 Priority of tags assigns in emoji.txt and custom.txt:
48
49 `tag in file > special group setting in config.exs > default setting in config.exs`
50
51 Priority for globs:
52
53 `special group setting in config.exs > default setting in config.exs`