Add license/copyright to all project files
[akkoma] / lib / pleroma / web / metadata / rel_me.ex
1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
4
5 defmodule Pleroma.Web.Metadata.Providers.RelMe do
6 alias Pleroma.Web.Metadata.Providers.Provider
7 @behaviour Provider
8
9 @impl Provider
10 def build_tags(%{user: user}) do
11 (Floki.attribute(user.bio, "link[rel~=me]", "href") ++
12 Floki.attribute(user.bio, "a[rel~=me]", "href"))
13 |> Enum.map(fn link ->
14 {:link, [rel: "me", href: link], []}
15 end)
16 end
17 end