Browse Source

Add config doc

tags/v0.9.9
rinpatch 5 years ago
parent
commit
bfe2a11a6b
2 changed files with 7 additions and 2 deletions
  1. +5
    -0
      docs/config.md
  2. +2
    -2
      lib/pleroma/web/metadata.ex

+ 5
- 0
docs/config.md View File

@@ -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

+ 2
- 2
lib/pleroma/web/metadata.ex View File

@@ -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()


Loading…
Cancel
Save