This commit is contained in:
ポール ウェッブ 2018-09-28 16:34:42 -05:00
parent 097bfc65c7
commit 7654917466
2 changed files with 39 additions and 18 deletions

View file

@ -17,9 +17,19 @@ let title = "";
// E X P O R T
module.exports = exports = (state, emit) => {
if (state.route !== "/" && state.params.wildcard) title = `${state.params.wildcard.capitalize()} ∙ LBRY ∙ ${config.meta.tagline}`;
else if (state.route === "api") title = `API ∙ LBRY ∙ ${config.meta.tagline}`;
else title = `LBRY ∙ ${config.meta.tagline}`;
switch(true) {
case (state.route !== "/" && state.params.wildcard):
title = `${state.params.wildcard.capitalize()} ∙ LBRY ∙ ${config.meta.tagline}`;
break;
case (state.route === "api"):
title = `API ∙ LBRY ∙ ${config.meta.tagline}`;
break;
default:
title = `LBRY ∙ ${config.meta.tagline}`;
break;
}
if (state.title !== title) emit(state.events.DOMTITLECHANGE, title);
state.page = state.page || { };

View file

@ -19,7 +19,17 @@ const apiScripts = "<script>" + fs.readFileSync("./app/components/client/api-scr
// E X P O R T
module.exports = exports = state => parseApiFile(state.params.wildcard).then(response => asyncHtml`
module.exports = exports = state => parseApiFile(state.params.wildcard).then(response => {
/*
state.lbry = {
description: "This is the API page for LBRY.tech",
"og:image": "/assets/media/images/carlsagan2.jpg",
"og:image:height": 300,
"og:image:width": 400
};
*/
return asyncHtml`
<div class="__slate">
<aside class="api__toc">
<div class="api__toc__search">
@ -36,7 +46,8 @@ module.exports = exports = state => parseApiFile(state.params.wildcard).then(res
<script src="/assets/scripts/plugins/jets.js"></script>
${raw(apiScripts)}
`);
`;
});