Merge pull request #2383 from wallabag/add-info-publich-articles

Added OpenGraph support for public articles
This commit is contained in:
Nicolas Lœuillet 2016-10-07 14:30:46 +02:00 committed by GitHub
commit c8d2dcdafe
13 changed files with 35 additions and 3 deletions

View File

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

View File

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

View File

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

View File

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

View File

@ -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: 'درباره'

View File

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

View File

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

View File

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

View File

@ -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'
@ -284,7 +286,7 @@ quickstart:
import: 'Skonfigurować import'
first_steps:
title: 'Pierwsze kroki'
description: "Teraz wallabag jest poprawnie skonfigurowany, więc czas zarchiwizować Internet. Klinknij w prawym górnym rogu na znak +, aby dodać link"
description: "Teraz wallabag jest poprawnie skonfigurowany, więc czas zarchiwizować Internet. Klinknij w prawym górnym rogu na znak +, aby dodać link"
new_article: 'Zapisz swój pierwszy artukuł'
unread_articles: 'I sklasyfikuj go!'
migrate:

View File

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

View File

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

View File

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

View File

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