From bfe2a11a6b64b868d18727359b83edc51ce5bb80 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Wed, 16 Jan 2019 10:45:56 +0300 Subject: [PATCH] Add config doc --- docs/config.md | 5 +++++ lib/pleroma/web/metadata.ex | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/config.md b/docs/config.md index e3738271b..c2104a9e8 100644 --- a/docs/config.md +++ b/docs/config.md @@ -210,3 +210,8 @@ curl "http://localhost:4000/api/pleroma/admin/invite_token?admin_token=somerando * `max_jobs`: The maximum amount of parallel federation jobs running at the same time. * `initial_timeout`: The initial timeout in seconds * `max_retries`: The maximum number of times a federation job is retried + +## Pleroma.Web.Metadata +* `providers`: a list of metadata providers to enable. Providers avalible: + * Pleroma.Web.Metadata.Providers.OpenGraph + * Pleroma.Web.Metadata.Providers.TwitterCard diff --git a/lib/pleroma/web/metadata.ex b/lib/pleroma/web/metadata.ex index 23f152e06..ddc74fb0d 100644 --- a/lib/pleroma/web/metadata.ex +++ b/lib/pleroma/web/metadata.ex @@ -1,7 +1,7 @@ defmodule Pleroma.Web.Metadata do alias Phoenix.HTML - @parsers Pleroma.Config.get([:metadata, :providers], []) + @providers Pleroma.Config.get([__MODULE__, :providers], []) def get_cached_tags(%{activity: activity, user: user} = params) do # We don't need to use the both activity and a user since the object can't change it's content key = "#{:erlang.term_to_binary(user)}#{activity.data["id"]}" @@ -29,7 +29,7 @@ defmodule Pleroma.Web.Metadata do end def build_tags(params) do - Enum.reduce(@parsers, "", fn parser, acc -> + Enum.reduce(@providers, "", fn parser, acc -> rendered_html = params |> parser.build_tags() -- 2.45.2