Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Pleroma
pleroma
Commits
ada38420
Commit
ada38420
authored
Apr 19, 2019
by
Alexander Strizhakov
Committed by
lain
Apr 19, 2019
Browse files
typo fix
docs for RelMe provider
parent
218d96a2
Changes
6
Hide whitespace changes
Inline
Side-by-side
CHANGELOG.md
View file @
ada38420
...
...
@@ -22,6 +22,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
-
Mastodon API:
`/api/v1/notifications/destroy_multiple`
(glitch-soc extension)
-
Mastodon API:
[
Reports
](
https://docs.joinmastodon.org/api/rest/reports/
)
-
ActivityPub C2S: OAuth endpoints
-
Metadata RelMe provider
### Changed
-
**Breaking:**
Configuration: move from Pleroma.Mailer to Pleroma.Emails.Mailer
...
...
README.md
View file @
ada38420
# Pleroma
**Note**
: This readme as well as complete documentation is also avail
i
ble at
<https://docs-develop.pleroma.social>
**Note**
: This readme as well as complete documentation is also avail
a
ble at
<https://docs-develop.pleroma.social>
## About Pleroma
...
...
config/config.exs
View file @
ada38420
...
...
@@ -337,7 +337,9 @@
ip:
{
0
,
0
,
0
,
0
},
port:
9999
config
:pleroma
,
Pleroma
.
Web
.
Metadata
,
providers:
[],
unfurl_nsfw:
false
config
:pleroma
,
Pleroma
.
Web
.
Metadata
,
providers:
[
Pleroma
.
Web
.
Metadata
.
Providers
.
RelMe
],
unfurl_nsfw:
false
config
:pleroma
,
:suggestions
,
enabled:
false
,
...
...
docs/config.md
View file @
ada38420
...
...
@@ -343,9 +343,10 @@ This config contains two queues: `federator_incoming` and `federator_outgoing`.
*
`max_retries`
: The maximum number of times a federation job is retried
## Pleroma.Web.Metadata
*
`providers`
: a list of metadata providers to enable. Providers avail
i
ble:
*
`providers`
: a list of metadata providers to enable. Providers avail
a
ble:
*
Pleroma.Web.Metadata.Providers.OpenGraph
*
Pleroma.Web.Metadata.Providers.TwitterCard
*
Pleroma.Web.Metadata.Providers.RelMe - add links from user bio with rel=me into the
`<header>`
as
`<link rel=me>`
*
`unfurl_nsfw`
: If set to
`true`
nsfw attachments will be shown in previews
## :rich_media
...
...
lib/pleroma/web/metadata/rel_me.ex
0 → 100644
View file @
ada38420
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
test/web/metadata/rel_me_test.exs
0 → 100644
View file @
ada38420
defmodule
Pleroma
.
Web
.
Metadata
.
Providers
.
RelMeTest
do
use
Pleroma
.
DataCase
import
Pleroma
.
Factory
alias
Pleroma
.
Web
.
Metadata
.
Providers
.
RelMe
test
"it renders all links with rel='me' from user bio"
do
bio
=
~s(<a href="https://some-link.com">https://some-link.com</a> <a rel="me" href="https://another-link.com">https://another-link.com</a>
<link href="http://some.com"> <link rel="me" href="http://some3.com>")
user
=
insert
(
:user
,
%{
bio:
bio
})
assert
RelMe
.
build_tags
(%{
user:
user
})
==
[
{
:link
,
[
rel:
"me"
,
href:
"http://some3.com>"
],
[]},
{
:link
,
[
rel:
"me"
,
href:
"https://another-link.com"
],
[]}
]
end
end
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment