defmodule Mobilizon.Service.Metadata.Instance do @moduledoc """ Generates metadata for every other page that isn't event/actor/comment """ alias Phoenix.HTML alias Phoenix.HTML.Tag alias Mobilizon.Config alias Mobilizon.Service.Metadata.Utils alias Mobilizon.Web.Endpoint @doc """ Build the list of tags for the instance """ @spec build_tags() :: list(Phoenix.HTML.safe()) def build_tags do description = Utils.process_description(Config.instance_description()) title = "#{Config.instance_name()} - Mobilizon" instance_json_ld = """ """ [ Tag.content_tag(:title, title), Tag.tag(:meta, name: "description", content: description), Tag.tag(:meta, property: "og:title", content: title), Tag.tag(:meta, property: "og:url", content: Endpoint.url()), Tag.tag(:meta, property: "og:description", content: description), Tag.tag(:meta, property: "og:type", content: "website"), HTML.raw(instance_json_ld) ] end end