Restore the favicon of the old documentation and add bigger icons

This commit is contained in:
ErickSkrauch committed 2026-10-28 22:37:09 +01:00
1 parent c05e92fa23
commit 640150ad08
8 files changed
+31 -2

No files matched your search

+14 -2
View File
@@ -185,8 +185,20 @@ const config: Config = {
} satisfies Preset.ThemeConfig,
plugins: [
'docusaurus-plugin-image-zoom'
]
'docusaurus-plugin-image-zoom',
// Icons in addition to the "favicon" above. Unlike the "headTags" option, a plugin knows the base url
// of the locale being built (/ru/, /en/), where the static files are located
(context) => ({
name: 'site-icons',
injectHtmlTags: () => ({
headTags: [
{tagName: 'link', attributes: {rel: 'icon', type: 'image/svg+xml', href: `${context.baseUrl}img/favicon.svg`}},
{tagName: 'link', attributes: {rel: 'apple-touch-icon', href: `${context.baseUrl}img/apple-touch-icon.png`}},
{tagName: 'link', attributes: {rel: 'manifest', href: `${context.baseUrl}site.webmanifest`}},
],
}),
}),
],
};
export default config;
+5
View File
@@ -42,6 +42,9 @@ cpSync(join(projectDir, 'root'), buildDir, {recursive: true});
// GitHub Pages only serves the 404.html from the site root
copyFileSync(join(buildDir, DEFAULT_PREFIX, '404.html'), join(buildDir, '404.html'));
// Browsers and other clients request /favicon.ico when a page doesn't declare its icons
copyFileSync(join(buildDir, DEFAULT_PREFIX, 'img', 'favicon.ico'), join(buildDir, 'favicon.ico'));
// The site root redirects to the documentation in the browser's language
const languagesMap = Object.fromEntries([
...RUSSIAN_SPEAKING.map((lang) => [lang, DEFAULT_PREFIX]),
@@ -55,6 +58,8 @@ writeFileSync(join(buildDir, 'index.html'), `<!DOCTYPE html>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Ely.by Documentation</title>
<link rel="icon" href="/favicon.ico" sizes="32x32">
<link rel="icon" href="/${DEFAULT_PREFIX}/img/favicon.svg" type="image/svg+xml">
${locales.map(({prefix, lang}) => ` <link rel="alternate" hreflang="${lang}" href="${SITE_URL}/${prefix}/">`).join('\n')}
<link rel="alternate" hreflang="x-default" href="${SITE_URL}/${DEFAULT_PREFIX}/">
<script>
Binary file not shown.

After

Width:  |  Height:  |  Size: 433 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 15 KiB

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" shape-rendering="crispEdges"><path fill="#000" d="M0 0h16v16H0z"/><path fill="#fff" d="M5 3h6v2H7v2h4v2H7v2h4v2H5z"/></svg>

After

Width:  |  Height:  |  Size: 184 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 468 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

+11
View File
@@ -0,0 +1,11 @@
{
"name": "Ely.by Documentation",
"short_name": "Ely.by Docs",
"icons": [
{"src": "img/icon-192.png", "sizes": "192x192", "type": "image/png"},
{"src": "img/icon-512.png", "sizes": "512x512", "type": "image/png"}
],
"theme_color": "#000000",
"background_color": "#000000",
"display": "browser"
}