Add twitter preview

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jinho Jang 2021-01-08 00:14:41 +09:00 committed by Jakub Sokołowski
parent 33bc461ca2
commit 6c95d11bfe
No known key found for this signature in database
GPG Key ID: 4EF064D0E6D63020
3 changed files with 7 additions and 1 deletions

BIN
public/img/logo.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

View File

@ -201,6 +201,9 @@ router.get('/qr_card/:data(*)', async (req, res) => {
`.trim()) `.trim())
}) })
/* provide rootUrl to all templates */
router.use((req, res, next) => { res.app.locals.rootUrl = utils.makeUrl(req); next(); })
router.get('/health', (req, res) => res.send('OK')) router.get('/health', (req, res) => res.send('OK'))
router.get('/b/:url(*)', handleSite) router.get('/b/:url(*)', handleSite)

View File

@ -26,7 +26,10 @@
<% } -%> <% } -%>
<!-- Formatting for Twitter link unfurling to fit QR code. --> <!-- Formatting for Twitter link unfurling to fit QR code. -->
<meta name="twitter:card" content="summary_large_image"> <meta name="twitter:card" content="summary" />
<meta name="twitter:site" content="@ethstatus" />
<meta property="twitter:image" content="<%= rootUrl %>/img/logo.jpg" />
<meta property="twitter:image:alt" content="Status logo" />
<% if (locals.path) { -%> <% if (locals.path) { -%>
<meta property="status-im:target" content="<%= mainTarget %>" /> <meta property="status-im:target" content="<%= mainTarget %>" />