Skip to content

Commit

Permalink
add twitter and open graph cards
Browse files Browse the repository at this point in the history
  • Loading branch information
johngruen committed Aug 11, 2017
1 parent a990d78 commit dafe00c
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 2 deletions.
Binary file added public/resources/send-fb.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/resources/send-twitter.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 14 additions & 1 deletion server/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,16 @@ function prodLangs() {

const availableLanguages = conf.l10n_dev ? allLangs() : prodLangs();

const envURL = (env) => {
switch (env) {
case 'test':
return 'https://send.stage.mozaws.net';
case 'development':
return 'https://testpilot.dev.mozaws.net';
}
return 'https://send.firefox.com';
}

if (conf.env === 'development') {
const webpack = require('webpack');
const webpackDevMiddleware = require('webpack-dev-middleware');
Expand All @@ -58,7 +68,10 @@ app.engine(
partialsDir: 'views/partials/',
helpers: {
availableLanguages,
l10nDev: conf.l10n_dev
l10nDev: conf.l10n_dev,
envURL: envURL(conf.env),
title: 'Firefox Send',
description: 'Encrypt and send files with a link that automatically expires to ensure your important documents don’t stay online forever.'
}
})
);
Expand Down
12 changes: 11 additions & 1 deletion views/layouts/main.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,17 @@
<meta name="defaultLanguage" content="en-US">
<meta name="availableLanguages" content="{{availableLanguages}}">

<title>Firefox Send</title>
<meta property="og:title" content="Firefox Send"/>
<meta name="twitter:title" content="Firefox Send"/>
<meta name="description" content="{{description}}"/>
<meta property="og:description" content="{{description}}"/>
<meta name="twitter:description" content="{{description}}"/>
<meta name="twitter:card" content="summary"/>
<meta property="og:image" content="{{envURL}}/resources/send-fb.jpg"/>
<meta name="twitter:image" content="{{envURL}}/resources/send-twitter.jpg"/>
<meta property="og:url" content="{{envURL}}"/>

<title>{{title}}</title>

<link rel="stylesheet" type="text/css" href="/main.css" />
{{#if fira}}
Expand Down

0 comments on commit dafe00c

Please sign in to comment.