Metadata is setup
This commit is contained in:
parent
988da355b6
commit
4a962f9a9b
4 changed files with 61 additions and 46 deletions
|
@ -3,10 +3,17 @@
|
||||||
|
|
||||||
|
|
||||||
module.exports = exports = {
|
module.exports = exports = {
|
||||||
|
ga: "UA-60403362-1",
|
||||||
github: {
|
github: {
|
||||||
branch: "new",
|
branch: "new",
|
||||||
linkText: "Edit this page on GitHub",
|
linkText: "Edit this page on GitHub",
|
||||||
repo: "lbryio/lbry.tech"
|
repo: "lbryio/lbry.tech"
|
||||||
},
|
},
|
||||||
ga: "UA-60403362-1"
|
meta: {
|
||||||
|
color: "#222",
|
||||||
|
description: "LBRY is a free, open, and community-run digital marketplace. Come check out our documentation and contribute!",
|
||||||
|
name: "LBRY",
|
||||||
|
tagline: "We came from the future to help you save the Internet",
|
||||||
|
title: "LBRY"
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -10,17 +10,15 @@ const html = require("choo-async/html");
|
||||||
|
|
||||||
// E X P O R T
|
// E X P O R T
|
||||||
|
|
||||||
module.exports = exports = (head, body) => {
|
module.exports = exports = (head, body) => (state, emit) => {
|
||||||
return (state, emit) => {
|
const bodyPromise = Promise.resolve(body(state, emit));
|
||||||
const bodyPromise = Promise.resolve(body(state, emit));
|
const headPromise = bodyPromise.then(() => head(state, emit)); // resolve `head` once `body` is resolved
|
||||||
const headPromise = bodyPromise.then(() => head(state, emit)); // resolve `head` once `body` is resolved
|
|
||||||
|
|
||||||
return html`
|
return html`
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
${headPromise}
|
${headPromise}
|
||||||
${bodyPromise}
|
${bodyPromise}
|
||||||
</html>
|
</html>
|
||||||
`;
|
`;
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -302,7 +302,7 @@ function step2() {
|
||||||
|
|
||||||
function step3() {
|
function step3() {
|
||||||
/**
|
/**
|
||||||
Step 2 loading steps:
|
Step 3 loading steps:
|
||||||
- exampleCode !== ''
|
- exampleCode !== ''
|
||||||
<pre><code class="bash"><span v-html="highlight('bash', exampleCode)"></span></code></pre>
|
<pre><code class="bash"><span v-html="highlight('bash', exampleCode)"></span></code></pre>
|
||||||
|
|
||||||
|
|
|
@ -2,48 +2,58 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// P A C K A G E
|
// P A C K A G E S
|
||||||
|
|
||||||
const html = require("choo-async/html");
|
const html = require("choo-async/html");
|
||||||
|
const local = require("app-root-path").require;
|
||||||
|
|
||||||
|
// V A R I A B L E
|
||||||
|
|
||||||
|
const config = local("/config");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// E X P O R T
|
// E X P O R T
|
||||||
|
|
||||||
module.exports = exports = () => async () => html`${[
|
module.exports = exports = () => async (state) => {
|
||||||
html`<meta charset="utf-8"/>`,
|
let pageTitle = "";
|
||||||
html`<title>LBRY · tagline</title>`,
|
|
||||||
|
|
||||||
html`<meta name="apple-mobile-web-app-capable" content="yes"/>`,
|
if (state.route && state.route !== "/" && state.route !== "*") pageTitle = state.route.charAt(0).toUpperCase() + state.route.slice(1);
|
||||||
html`<meta name="author" content="tagline"/>`,
|
if (state.params.wildcard) pageTitle = state.params.wildcard.charAt(0).toUpperCase() + state.params.wildcard.slice(1);
|
||||||
html`<meta name="description" content="description"/>`,
|
|
||||||
html`<meta name="title" content="tagline"/>`,
|
|
||||||
html`<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1, maximum-scale=1"/>`,
|
|
||||||
|
|
||||||
// Open Graph
|
return html`${[
|
||||||
html`<meta property="og:type" content="website"/>`,
|
html`<meta charset="utf-8"/>`,
|
||||||
html`<meta property="og:title" content="name"/>`,
|
html`<title>${pageTitle.length ? pageTitle + " | " : ""}${config.meta.title} · ${config.meta.tagline}</title>`,
|
||||||
html`<meta property="og:url" content="url"/>`,
|
|
||||||
html`<meta property="og:site_name" content="name"/>`,
|
|
||||||
html`<meta property="og:image" content="/assets/apple-touch-icon.png"/>`,
|
|
||||||
html`<meta property="og:locale" content="en_US"/>`,
|
|
||||||
|
|
||||||
// Social/App Stuff
|
html`<meta name="apple-mobile-web-app-capable" content="yes"/>`,
|
||||||
html`<meta name="apple-mobile-web-app-title" content="name"/>`,
|
html`<meta name="author" content="${config.meta.title}"/>`,
|
||||||
html`<meta name="application-name" content="name"/>`,
|
html`<meta name="description" content="${config.meta.description}"/>`,
|
||||||
html`<meta name="msapplication-TileColor" content="#111"/>`,
|
html`<meta name="title" content="${config.meta.tagline}"/>`,
|
||||||
html`<meta name="msapplication-TileImage" content="/assets/apple-touch-icon.png"/>`,
|
html`<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1, maximum-scale=1"/>`,
|
||||||
html`<meta name="theme-color" content="#111"/>`,
|
|
||||||
html`<meta name="socii:site" content="∴ name"/>`,
|
|
||||||
|
|
||||||
html`<link rel="apple-touch-icon" href="/assets/apple-touch-icon.png"/>`,
|
// Open Graph
|
||||||
html`<link rel="icon" href="/assets/favicon.svg" type="image/svg+xml"/>`,
|
html`<meta property="og:type" content="website"/>`,
|
||||||
html`<link rel="mask-icon" href="/assets/favicon.svg" color="#111"/>`,
|
html`<meta property="og:title" content="${config.meta.title}"/>`,
|
||||||
html`<link rel="stylesheet" href="/assets/css/style.css"/>`,
|
html`<meta property="og:url" content="url"/>`,
|
||||||
|
html`<meta property="og:site_name" content="${config.meta.title}"/>`,
|
||||||
|
html`<meta property="og:image" content="/assets/apple-touch-icon.png"/>`,
|
||||||
|
html`<meta property="og:locale" content="en_US"/>`,
|
||||||
|
|
||||||
html`<script src="/assets/scripts/vendor/zepto.js"></script>`,
|
// Social/App Stuff
|
||||||
html`<script>const ws = new WebSocket(location.origin.replace(/^http/, "ws"));</script>`,
|
html`<meta name="apple-mobile-web-app-title" content="${config.meta.title}"/>`,
|
||||||
html`<script src="/assets/scripts/sockets.js"></script>`
|
html`<meta name="application-name" content="${config.meta.title}"/>`,
|
||||||
]}`;
|
html`<meta name="msapplication-TileColor" content="${config.meta.color}"/>`,
|
||||||
|
html`<meta name="msapplication-TileImage" content="/assets/apple-touch-icon.png"/>`,
|
||||||
|
html`<meta name="theme-color" content="${config.meta.color}"/>`,
|
||||||
|
html`<meta name="socii:site" content="∴ ${config.meta.name}"/>`,
|
||||||
|
|
||||||
// TODO: Update meta details
|
html`<link rel="apple-touch-icon" href="/assets/apple-touch-icon.png"/>`,
|
||||||
|
html`<link rel="icon" href="/assets/favicon.svg" type="image/svg+xml"/>`,
|
||||||
|
html`<link rel="mask-icon" href="/assets/favicon.svg" color="${config.meta.color}"/>`,
|
||||||
|
html`<link rel="stylesheet" href="/assets/css/style.css"/>`,
|
||||||
|
|
||||||
|
html`<script src="/assets/scripts/vendor/zepto.js"></script>`,
|
||||||
|
html`<script>const ws = new WebSocket(location.origin.replace(/^http/, "ws"));</script>`,
|
||||||
|
html`<script src="/assets/scripts/sockets.js"></script>`
|
||||||
|
]}`;
|
||||||
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue