mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
fix: some style
This commit is contained in:
parent
6cb81d7b7c
commit
37864a07ce
@ -92,18 +92,23 @@ const createServer = async (req) => {
|
|||||||
let title = 'AppFlowy';
|
let title = 'AppFlowy';
|
||||||
const url = 'https://appflowy.io';
|
const url = 'https://appflowy.io';
|
||||||
let image = logo;
|
let image = logo;
|
||||||
// Inject meta data into the HTML to support SEO and social sharing
|
|
||||||
if (metaData) {
|
|
||||||
title = `${metaData.view.name} | AppFlowy`;
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const cover = metaData.view.extra ? JSON.parse(metaData.view.extra)?.cover : null;
|
// Inject meta data into the HTML to support SEO and social sharing
|
||||||
if (cover && ['unsplash', 'custom'].includes(cover.type)) {
|
if (metaData && metaData.view) {
|
||||||
image = cover.value;
|
title = `${metaData.view.name} | AppFlowy`;
|
||||||
|
|
||||||
|
try {
|
||||||
|
const cover = metaData.view.extra ? JSON.parse(metaData.view.extra)?.cover : null;
|
||||||
|
if (cover && ['unsplash', 'custom'].includes(cover.type)) {
|
||||||
|
image = cover.value;
|
||||||
|
}
|
||||||
|
} catch (_) {
|
||||||
|
// Do nothing
|
||||||
}
|
}
|
||||||
} catch (_) {
|
|
||||||
// Do nothing
|
|
||||||
}
|
}
|
||||||
|
} catch (error) {
|
||||||
|
logger.error(`Error injecting meta data: ${error}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
$('title').text(title);
|
$('title').text(title);
|
||||||
|
Loading…
Reference in New Issue
Block a user