drop.chapril.org-firefoxsend/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-08 00:40:17 +02:00
const initScript = require('./initScript');
module.exports = function(state, body = '') {
return html`
2018-11-16 21:39:36 +01:00
<!DOCTYPE html>
<html lang="${state.locale}">
<head>
2019-02-19 21:52:09 +01:00
<title>${state.title}</title>
<base href="/" />
2018-11-16 21:39:36 +01: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 21:39:36 +01: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"
content="${state.baseUrl}${assets.get('send-fb.jpg')}"
/>
<meta
name="twitter:image"
content="${state.baseUrl}${assets.get('send-twitter.jpg')}"
/>
<meta property="og:url" content="${state.baseUrl}" />
2019-03-10 01:45:17 +01:00
<meta name="theme-color" content="#220033" />
<meta name="msapplication-TileColor" content="#220033" />
2019-02-19 21:52:09 +01:00
<link rel="manifest" href="/app.webmanifest" />
2019-02-14 20:39:28 +01:00
<link rel="stylesheet" type="text/css" href="/inter.css" />
2018-11-16 21:39:36 +01:00
<link
rel="stylesheet"
type="text/css"
href="${assets.get('app.css')}"
/>
<link
2019-02-19 21:52:09 +01:00
rel="apple-touch-icon"
sizes="180x180"
href="${assets.get('apple-touch-icon.png')}"
2018-11-16 21:39:36 +01:00
/>
<link
rel="icon"
2019-02-19 21:52:09 +01:00
type="image/png"
sizes="32x32"
href="${assets.get('favicon-32x32.png')}"
2018-11-16 21:39:36 +01:00
/>
<link
2019-02-19 21:52:09 +01:00
rel="icon"
type="image/png"
sizes="16x16"
href="${assets.get('favicon-16x16.png')}"
2018-11-16 21:39:36 +01:00
/>
<link
2019-02-19 21:52:09 +01:00
rel="mask-icon"
href="${assets.get('safari-pinned-tab.svg')}"
2019-02-19 23:14:28 +01:00
color="#838383"
2018-11-16 21:39:36 +01: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>
`;
};