distraction.party/lib/pleroma/web/metadata/rel_me.ex
Alexander Strizhakov ada384207b typo fix
docs for RelMe provider
2019-04-19 07:50:21 +00:00

13 lines
377 B
Elixir

defmodule Pleroma.Web.Metadata.Providers.RelMe do
alias Pleroma.Web.Metadata.Providers.Provider
@behaviour Provider
@impl Provider
def build_tags(%{user: user}) do
(Floki.attribute(user.bio, "link[rel~=me]", "href") ++
Floki.attribute(user.bio, "a[rel~=me]", "href"))
|> Enum.map(fn link ->
{:link, [rel: "me", href: link], []}
end)
end
end