mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 04:18:54 +00:00
@@ -154,40 +154,49 @@ export class DocRendererController {
|
|||||||
const summary = opts ? htmlSanitize(opts.summary) : assets.description;
|
const summary = opts ? htmlSanitize(opts.summary) : assets.description;
|
||||||
const image = opts?.avatar ?? 'https://affine.pro/og.jpeg';
|
const image = opts?.avatar ?? 'https://affine.pro/og.jpeg';
|
||||||
|
|
||||||
return `
|
// TODO(@forehalo): parse assets/index.html
|
||||||
<!DOCTYPE html>
|
return `<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<meta
|
<meta
|
||||||
name="viewport"
|
name="viewport"
|
||||||
content="width=device-width, initial-scale=1, maximum-scale=1"
|
content="width=device-width, initial-scale=1, maximum-scale=1"
|
||||||
/>
|
/>
|
||||||
<title>${title}</title>
|
|
||||||
<meta name="theme-color" content="#fafafa" />
|
<meta name="mobile-web-app-capable" content="yes" />
|
||||||
<link rel="preconnect" href="${assets.publicPath}">
|
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||||
<link rel="manifest" href="/manifest.json" />
|
<meta
|
||||||
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
|
name="apple-mobile-web-app-status-bar-style"
|
||||||
<link rel="icon" sizes="192x192" href="/favicon-192.png" />
|
content="black-translucent"
|
||||||
<meta name="emotion-insertion-point" content="" />
|
/>
|
||||||
${!opts ? '<meta name="robots" content="noindex, nofollow" />' : ''}
|
|
||||||
<meta
|
<title>${title}</title>
|
||||||
name="twitter:title"
|
<meta name="theme-color" content="#fafafa" />
|
||||||
content="${title}"
|
<link rel="preconnect" href="${assets.publicPath}">
|
||||||
/>
|
<link rel="manifest" href="/manifest.json" />
|
||||||
<meta name="twitter:description" content="${summary}" />
|
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
|
||||||
<meta name="twitter:site" content="@AffineOfficial" />
|
<link rel="icon" sizes="192x192" href="/favicon-192.png" />
|
||||||
<meta name="twitter:image" content="${image}" />
|
<link rel="shortcut icon" href="/favicon.ico" />
|
||||||
<meta property="og:title" content="${title}" />
|
<meta name="emotion-insertion-point" content="" />
|
||||||
<meta property="og:description" content="${summary}" />
|
${!opts ? '<meta name="robots" content="noindex, nofollow" />' : ''}
|
||||||
<meta property="og:image" content="${image}" />
|
<meta
|
||||||
${assets.css.map(url => `<link rel="stylesheet" href="${url}" />`).join('\n')}
|
name="twitter:title"
|
||||||
</head>
|
content="${title}"
|
||||||
<body>
|
/>
|
||||||
<div id="app" data-version="${assets.gitHash}"></div>
|
<meta name="twitter:description" content="${summary}" />
|
||||||
${assets.js.map(url => `<script type="module" src="${url}"></script>`).join('\n')}
|
<meta name="twitter:site" content="@AffineOfficial" />
|
||||||
</body>
|
<meta name="twitter:image" content="${image}" />
|
||||||
</html>
|
<meta property="og:title" content="${title}" />
|
||||||
|
<meta property="og:description" content="${summary}" />
|
||||||
|
<meta property="og:image" content="${image}" />
|
||||||
|
${assets.css.map(url => `<link rel="stylesheet" href="${url}" />`).join('\n')}
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="app" data-version="${assets.gitHash}"></div>
|
||||||
|
${assets.js.map(url => `<script src="${url}"></script>`).join('\n')}
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
<link rel="manifest" href="/manifest.json" />
|
<link rel="manifest" href="/manifest.json" />
|
||||||
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
|
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
|
||||||
<link rel="icon" sizes="192x192" href="/favicon-192.png" />
|
<link rel="icon" sizes="192x192" href="/favicon-192.png" />
|
||||||
|
<link rel="shortcut icon" href="/favicon.ico" />
|
||||||
<meta name="emotion-insertion-point" content="" />
|
<meta name="emotion-insertion-point" content="" />
|
||||||
<meta property="description" content="<%= DESCRIPTION %>" />
|
<meta property="description" content="<%= DESCRIPTION %>" />
|
||||||
<meta name="twitter:card" content="summary_large_image" />
|
<meta name="twitter:card" content="summary_large_image" />
|
||||||
@@ -39,7 +40,6 @@
|
|||||||
<meta property="og:description" content="<%= DESCRIPTION %>" />
|
<meta property="og:description" content="<%= DESCRIPTION %>" />
|
||||||
<meta property="og:url" content="https://app.affine.pro/" />
|
<meta property="og:url" content="https://app.affine.pro/" />
|
||||||
<meta property="og:image" content="https://affine.pro/og.jpeg" />
|
<meta property="og:image" content="https://affine.pro/og.jpeg" />
|
||||||
<link data-react-helmet="true" rel="shortcut icon" href="/favicon.ico" />
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
@@ -45,7 +45,6 @@ export function createWebpackConfig(cwd: string, flags: BuildFlags) {
|
|||||||
return new HTMLPlugin({
|
return new HTMLPlugin({
|
||||||
template: join(rootPath, 'webpack', 'template.html'),
|
template: join(rootPath, 'webpack', 'template.html'),
|
||||||
inject: 'body',
|
inject: 'body',
|
||||||
scriptLoading: 'module',
|
|
||||||
minify: false,
|
minify: false,
|
||||||
chunks: [entryName],
|
chunks: [entryName],
|
||||||
filename: `${entryName === 'app' ? 'index' : entryName}.html`, // main entry should take name index.html
|
filename: `${entryName === 'app' ? 'index' : entryName}.html`, // main entry should take name index.html
|
||||||
|
|||||||
Reference in New Issue
Block a user