"use strict"; // P A C K A G E import html from "choo/html"; import { require as local } from "app-root-path"; // V A R I A B L E S const config = local("/config"); let title = ""; // E X P O R T module.exports = exports = (state, emit) => { /* let pageTitle = ""; if (state.route && state.route !== "/" && state.route !== "*") pageTitle = state.route.charAt(0).toUpperCase() + state.route.slice(1); if (state.params.wildcard) pageTitle = state.params.wildcard.charAt(0).toUpperCase() + state.params.wildcard.slice(1); if (pageTitle === "Api") pageTitle = "API"; ${pageTitle.length ? pageTitle + " | " : ""}${config.meta.title} · ${config.meta.tagline} */ if (state.route !== "/" && state.params.wildcard) title = `${state.params.wildcard.capitalize()} ∙ LBRY ∙ ${config.meta.tagline}`; else title = `LBRY ∙ ${config.meta.tagline}`; if (state.title !== title) emit(state.events.DOMTITLECHANGE, title); state.page = state.page || { }; // TODO: // - Support custom metadata (descriptions and whatnot) // - Update og:url with current URL return html` ${title} `; // state.route === "api" || state.route === "api/*" ? : "" }; // H E L P E R String.prototype.capitalize = function () { return this.charAt(0).toUpperCase() + this.slice(1); };