send/server/layout.js

83 lines
2.7 KiB
JavaScript
Raw Normal View History

const html = require('choo/html');
const assets = require('../common/assets');
2018-08-07 22:40:17 +00:00
const initScript = require('./initScript');
module.exports = function(state, body = '') {
return html`
2018-11-16 20:39:36 +00:00
<!DOCTYPE html>
<html lang="${state.locale}">
<head>
2019-02-19 20:52:09 +00:00
<title>${state.title}</title>
<base href="/" />
2018-11-16 20:39:36 +00:00
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
2018-11-16 20:39:36 +00:00
<meta property="og:title" content="${state.title}" />
<meta name="twitter:title" content="${state.title}" />
<meta name="description" content="${state.description}" />
<meta property="og:description" content="${state.description}" />
<meta name="twitter:description" content="${state.description}" />
<meta name="twitter:card" content="summary" />
<meta
property="og:image"
2019-03-12 16:57:26 +00:00
content="${state.baseUrl}/${assets.get('send-fb.jpg')}"
2018-11-16 20:39:36 +00:00
/>
<meta
name="twitter:image"
2019-03-12 16:57:26 +00:00
content="${state.baseUrl}/${assets.get('send-twitter.jpg')}"
2018-11-16 20:39:36 +00:00
/>
<meta property="og:url" content="${state.baseUrl}" />
2019-03-10 00:45:17 +00:00
<meta name="theme-color" content="#220033" />
<meta name="msapplication-TileColor" content="#220033" />
2019-02-19 20:52:09 +00:00
<link rel="manifest" href="/app.webmanifest" />
2019-02-14 19:39:28 +00:00
<link rel="stylesheet" type="text/css" href="/inter.css" />
2018-11-16 20:39:36 +00:00
<link
rel="stylesheet"
type="text/css"
href="${assets.get('app.css')}"
/>
<link
2019-02-19 20:52:09 +00:00
rel="apple-touch-icon"
sizes="180x180"
href="${assets.get('apple-touch-icon.png')}"
2018-11-16 20:39:36 +00:00
/>
<link
rel="icon"
2019-02-19 20:52:09 +00:00
type="image/png"
sizes="32x32"
href="${assets.get('favicon-32x32.png')}"
2018-11-16 20:39:36 +00:00
/>
<link
2019-02-19 20:52:09 +00:00
rel="icon"
type="image/png"
sizes="16x16"
href="${assets.get('favicon-16x16.png')}"
2018-11-16 20:39:36 +00:00
/>
<link
2019-02-19 20:52:09 +00:00
rel="mask-icon"
href="${assets.get('safari-pinned-tab.svg')}"
2019-02-19 22:14:28 +00:00
color="#838383"
2018-11-16 20:39:36 +00:00
/>
<script defer src="${assets.get('app.js')}"></script>
</head>
<noscript>
<div class="noscript">
<h2>${state.translate('javascriptRequired')}</h2>
<p>
<a
class="link"
href="https://github.com/mozilla/send/blob/master/docs/faq.md#why-does-firefox-send-require-javascript"
>
${state.translate('whyJavascript')}
</a>
</p>
<p>${state.translate('enableJavascript')}</p>
</div>
</noscript>
${body} ${initScript(state)}
</html>
`;
};