mirror of
https://github.com/wallabag/wallabag.git
synced 2024-11-26 19:11:07 +00:00
Merge pull request #2383 from wallabag/add-info-publich-articles
Added OpenGraph support for public articles
This commit is contained in:
commit
c8d2dcdafe
13 changed files with 35 additions and 3 deletions
|
@ -208,6 +208,8 @@ entry:
|
|||
url_label: 'Url'
|
||||
# is_public_label: 'Public'
|
||||
save_label: 'Gem'
|
||||
public:
|
||||
# shared_by_wallabag: "This article has been shared by <a href=%wallabag_instance%'>wallabag</a>"
|
||||
|
||||
about:
|
||||
page_title: 'Om'
|
||||
|
|
|
@ -208,6 +208,8 @@ entry:
|
|||
url_label: 'URL'
|
||||
is_public_label: 'Öffentlich'
|
||||
save_label: 'Speichern'
|
||||
public:
|
||||
# shared_by_wallabag: "This article has been shared by <a href='%wallabag_instance%'>wallabag</a>"
|
||||
|
||||
about:
|
||||
page_title: 'Über'
|
||||
|
|
|
@ -208,6 +208,8 @@ entry:
|
|||
url_label: 'Url'
|
||||
is_public_label: 'Public'
|
||||
save_label: 'Save'
|
||||
public:
|
||||
shared_by_wallabag: "This article has been shared by <a href='%wallabag_instance%'>wallabag</a>"
|
||||
|
||||
about:
|
||||
page_title: 'About'
|
||||
|
|
|
@ -208,6 +208,8 @@ entry:
|
|||
url_label: 'Url'
|
||||
is_public_label: 'Es Público'
|
||||
save_label: 'Guardar'
|
||||
public:
|
||||
# shared_by_wallabag: "This article has been shared by <a href='%wallabag_instance%'>wallabag</a>"
|
||||
|
||||
about:
|
||||
page_title: 'Acerca de'
|
||||
|
|
|
@ -208,6 +208,8 @@ entry:
|
|||
url_label: 'نشانی'
|
||||
is_public_label: 'عمومی'
|
||||
save_label: 'ذخیره'
|
||||
public:
|
||||
# shared_by_wallabag: "This article has been shared by <a href='%wallabag_instance%'>wallabag</a>"
|
||||
|
||||
about:
|
||||
page_title: 'درباره'
|
||||
|
|
|
@ -208,6 +208,8 @@ entry:
|
|||
url_label: 'Url'
|
||||
is_public_label: 'Public'
|
||||
save_label: 'Enregistrer'
|
||||
public:
|
||||
shared_by_wallabag: "Cet article a été partagé par <a href='%wallabag_instance%'>wallabag</a>"
|
||||
|
||||
about:
|
||||
page_title: 'À propos'
|
||||
|
|
|
@ -208,6 +208,8 @@ entry:
|
|||
url_label: 'Url'
|
||||
is_public_label: 'Pubblico'
|
||||
save_label: 'Salva'
|
||||
public:
|
||||
# shared_by_wallabag: "This article has been shared by <a href='%wallabag_instance%'>wallabag</a>"
|
||||
|
||||
about:
|
||||
page_title: 'About'
|
||||
|
|
|
@ -208,6 +208,8 @@ entry:
|
|||
url_label: 'Url'
|
||||
is_public_label: 'Public'
|
||||
save_label: 'Enregistrar'
|
||||
public:
|
||||
# shared_by_wallabag: "This article has been shared by <a href='%wallabag_instance%'>wallabag</a>"
|
||||
|
||||
about:
|
||||
page_title: 'A prepaus'
|
||||
|
|
|
@ -208,6 +208,8 @@ entry:
|
|||
url_label: 'Adres URL'
|
||||
is_public_label: 'Publiczny'
|
||||
save_label: 'Zapisz'
|
||||
public:
|
||||
# shared_by_wallabag: "This article has been shared by <a href='%wallabag_instance%'>wallabag</a>"
|
||||
|
||||
about:
|
||||
page_title: 'O nas'
|
||||
|
|
|
@ -208,6 +208,8 @@ entry:
|
|||
url_label: 'Url'
|
||||
# is_public_label: 'Public'
|
||||
save_label: 'Salvează'
|
||||
public:
|
||||
# shared_by_wallabag: "This article has been shared by <a href='%wallabag_instance%'>wallabag</a>"
|
||||
|
||||
about:
|
||||
page_title: 'Despre'
|
||||
|
|
|
@ -207,6 +207,8 @@ entry:
|
|||
url_label: 'Url'
|
||||
is_public_label: 'Herkes tarafından erişime açık olsun mu?'
|
||||
save_label: 'Kaydet'
|
||||
public:
|
||||
# shared_by_wallabag: "This article has been shared by <a href='%wallabag_instance%'>wallabag</a>"
|
||||
|
||||
about:
|
||||
page_title: 'Hakkımızda'
|
||||
|
|
|
@ -27,11 +27,18 @@
|
|||
width: 600px;
|
||||
}
|
||||
</style>
|
||||
<meta property="og:title" content="{{ entry.title | raw }}" />
|
||||
<meta property="og:type" content="article" />
|
||||
<meta property="og:url" content="{{ app.request.uri }}" />
|
||||
{% if entry.previewPicture is not null %}
|
||||
<meta property="og:image" content="{{ entry.previewPicture }}" />
|
||||
{% endif %}
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<h1>{{ entry.title | raw }}</h1>
|
||||
<span><a href="{{ entry.url|e }}" target="_blank" title="{{ 'entry.view.original_article'|trans }} : {{ entry.title|e }}" class="tool">{{ entry.domainName|removeWww }}</a></span>
|
||||
<div><a href="{{ entry.url|e }}" target="_blank" title="{{ 'entry.view.original_article'|trans }} : {{ entry.title|e }}" class="tool">{{ entry.domainName|removeWww }}</a></div>
|
||||
<div>{{ "entry.public.shared_by_wallabag"|trans({'%wallabag_instance%': url('homepage')})|raw }}</div>
|
||||
</header>
|
||||
<article>
|
||||
{{ entry.content | raw }}
|
||||
|
|
|
@ -753,7 +753,7 @@ class EntryControllerTest extends WallabagCoreTestCase
|
|||
$this->assertCount(2, $crawler->filter('div[class=entry]'));
|
||||
}
|
||||
|
||||
public function testCache()
|
||||
public function testShareEntryPublicly()
|
||||
{
|
||||
$this->logInAs('admin');
|
||||
$client = $this->getClient();
|
||||
|
@ -778,6 +778,9 @@ class EntryControllerTest extends WallabagCoreTestCase
|
|||
$this->assertContains('public', $client->getResponse()->headers->get('cache-control'));
|
||||
$this->assertContains('s-maxage=25200', $client->getResponse()->headers->get('cache-control'));
|
||||
$this->assertNotContains('no-cache', $client->getResponse()->headers->get('cache-control'));
|
||||
$this->assertContains('og:title', $client->getResponse()->getContent());
|
||||
$this->assertContains('og:type', $client->getResponse()->getContent());
|
||||
$this->assertContains('og:url', $client->getResponse()->getContent());
|
||||
|
||||
// sharing is now disabled
|
||||
$client->getContainer()->get('craue_config')->set('share_public', 0);
|
||||
|
|
Loading…
Reference in a new issue