f90089e1bf
Use Upload Media logic from Pleroma Backend changes for picture upload Move AS <-> Model conversion to separate module Front changes Downgrade apollo-client: https://github.com/Akryum/vue-apollo/issues/577 Signed-off-by: Thomas Citharel <tcit@tcit.fr>
22 lines
777 B
Elixir
22 lines
777 B
Elixir
defimpl Mobilizon.Service.Metadata, for: Mobilizon.Actors.Actor do
|
|
alias Phoenix.HTML.Tag
|
|
alias Mobilizon.Actors.Actor
|
|
|
|
def build_tags(%Actor{} = actor) do
|
|
tags = [
|
|
Tag.tag(:meta, property: "og:title", content: Actor.display_name_and_username(actor)),
|
|
Tag.tag(:meta, property: "og:url", content: actor.url),
|
|
Tag.tag(:meta, property: "og:description", content: actor.summary),
|
|
Tag.tag(:meta, property: "og:type", content: "profile"),
|
|
Tag.tag(:meta, property: "profile:username", content: actor.preferred_username),
|
|
Tag.tag(:meta, property: "twitter:card", content: "summary")
|
|
]
|
|
|
|
if is_nil(actor.avatar) do
|
|
tags
|
|
else
|
|
tags ++ [Tag.tag(:meta, property: "og:image", content: actor.avatar.url)]
|
|
end
|
|
end
|
|
end
|