favicon custom

html fav tag remove

basic meta favi

missing favicon

recon
This commit is contained in:
zeppi 2021-07-23 11:34:11 -04:00 committed by jessopb
parent aed3e98c79
commit 1e9dabe6e2
4 changed files with 21 additions and 9 deletions

View file

@ -5,7 +5,6 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="Pragma" content="no-cache" /> <meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" /> <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<link rel="icon" type="image/png" href="/public/favicon.png" />
<link rel="preload" href="/public/font/v1/300.woff" as="font" type="font/woff" crossorigin /> <link rel="preload" href="/public/font/v1/300.woff" as="font" type="font/woff" crossorigin />
<link rel="preload" href="/public/font/v1/300i.woff" as="font" type="font/woff" crossorigin /> <link rel="preload" href="/public/font/v1/300i.woff" as="font" type="font/woff" crossorigin />

View file

@ -8,6 +8,7 @@ const {
OG_IMAGE_URL, OG_IMAGE_URL,
SITE_DESCRIPTION, SITE_DESCRIPTION,
SITE_NAME, SITE_NAME,
FAVICON,
} = require('../../config.js'); } = require('../../config.js');
const { generateEmbedUrl, generateStreamUrl, generateDirectUrl } = require('../../ui/util/web'); const { generateEmbedUrl, generateStreamUrl, generateDirectUrl } = require('../../ui/util/web');
const PAGES = require('../../ui/constants/pages'); const PAGES = require('../../ui/constants/pages');
@ -89,13 +90,24 @@ function conditionallyAddPWA() {
return head; return head;
} }
function addFavicon() {
let head = '';
head += `<link rel="icon" type="image/png" href="${FAVICON || './public/favicon.png'}" />`;
return head;
}
function buildHead() { function buildHead() {
const head = '<!-- VARIABLE_HEAD_BEGIN -->' + conditionallyAddPWA() + buildOgMetadata() + '<!-- VARIABLE_HEAD_END -->'; const head =
'<!-- VARIABLE_HEAD_BEGIN -->' +
addFavicon() +
conditionallyAddPWA() +
buildOgMetadata() +
'<!-- VARIABLE_HEAD_END -->';
return head; return head;
} }
function buildBasicOgMetadata() { function buildBasicOgMetadata() {
const head = '<!-- VARIABLE_HEAD_BEGIN -->' + buildOgMetadata() + '<!-- VARIABLE_HEAD_END -->'; const head = '<!-- VARIABLE_HEAD_BEGIN -->' + addFavicon() + buildOgMetadata() + '<!-- VARIABLE_HEAD_END -->';
return head; return head;
} }
@ -128,6 +140,7 @@ function buildClaimOgMetadata(uri, claim, overrideOptions = {}) {
let head = ''; let head = '';
head += `${addFavicon()}`;
head += '<meta charset="utf8"/>'; head += '<meta charset="utf8"/>';
head += `<title>${title}</title>`; head += `<title>${title}</title>`;
head += `<meta name="description" content="${cleanDescription}"/>`; head += `<meta name="description" content="${cleanDescription}"/>`;

View file

@ -1,5 +1,5 @@
const { generateDownloadUrl } = require('../../ui/util/web'); const { generateDownloadUrl } = require('../../ui/util/web');
const { URL, SITE_NAME, LBRY_WEB_API } = require('../../config.js'); const { URL, SITE_NAME, LBRY_WEB_API, FAVICON } = require('../../config.js');
const { Lbry } = require('lbry-redux'); const { Lbry } = require('lbry-redux');
const Feed = require('feed').Feed; const Feed = require('feed').Feed;
@ -82,7 +82,7 @@ async function getFeed(channelClaim, feedLink) {
const title = value ? value.title : channelClaim.name; const title = value ? value.title : channelClaim.name;
const options = { const options = {
favicon: URL + '/public/favicon.png', favicon: FAVICON || URL + '/public/favicon.png',
generator: SITE_NAME + ' RSS Feed', generator: SITE_NAME + ' RSS Feed',
title: title + ' on ' + SITE_NAME, title: title + ' on ' + SITE_NAME,
description: fmtDescription(value && value.description ? value.description : ''), description: fmtDescription(value && value.description ? value.description : ''),

View file

@ -1,11 +1,11 @@
const { URL, SITE_TITLE } = require('../../config.js'); const { URL, SITE_TITLE, FAVICON } = require('../../config.js');
const favicon = FAVICON || `${URL}/public/favicon.png`;
function getOpenSearchXml() { function getOpenSearchXml() {
return ( return (
`<ShortName>${SITE_TITLE}</ShortName>` + `<ShortName>${SITE_TITLE}</ShortName>` +
`<Description>Search ${SITE_TITLE}</Description>` + `<Description>Search ${SITE_TITLE}</Description>` +
'<InputEncoding>UTF-8</InputEncoding>' + '<InputEncoding>UTF-8</InputEncoding>' +
`<Image width="32" height="32" type="image/png">${URL}/public/favicon.png</Image>` + `<Image width="32" height="32" type="image/png">${favicon}</Image>` +
`<Url type="text/html" method="get" template="${URL}/$/search?q={searchTerms}"/>` + `<Url type="text/html" method="get" template="${URL}/$/search?q={searchTerms}"/>` +
`<moz:SearchForm>${URL}</moz:SearchForm>` `<moz:SearchForm>${URL}</moz:SearchForm>`
); );