From 6a74511b1195369fd7b070715007c051ed5f8c02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9E=D0=BB=D0=B5=D0=B3=20=D0=A9=D0=B0=D0=B2=D0=B5=D0=BB?= =?UTF-8?q?=D0=B5=D0=B2?= Date: Thu, 26 Sep 2024 02:36:13 +0300 Subject: [PATCH] =?UTF-8?q?refactor:=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=20=D1=84=D0=B0=D0=B9=D0=BB=20=D1=81=D1=82?= =?UTF-8?q?=D0=B8=D0=BB=D0=B5=D0=B9=20icons.css,=20=D0=BF=D0=B5=D1=80?= =?UTF-8?q?=D0=B5=D0=BD=D0=B5=D1=81=D0=B5=D0=BD=D1=8B=20=D0=BF=D0=BE=D0=BB?= =?UTF-8?q?=D1=8C=D0=B7=D0=BE=D0=B2=D0=B0=D1=82=D0=B5=D0=BB=D1=8C=D1=81?= =?UTF-8?q?=D0=BA=D0=B8=D0=B5=20=D0=B8=D0=BA=D0=BE=D0=BD=D0=BA=D0=B8(#39).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vitepress/config/shared.ts | 12 +++++------ .vitepress/data/icons.ts | 34 ------------------------------- .vitepress/theme/index.ts | 1 + .vitepress/theme/styles/icons.css | 12 +++++++++++ 4 files changed, 18 insertions(+), 41 deletions(-) delete mode 100644 .vitepress/data/icons.ts create mode 100644 .vitepress/theme/styles/icons.css diff --git a/.vitepress/config/shared.ts b/.vitepress/config/shared.ts index 2c06b68..f168e71 100644 --- a/.vitepress/config/shared.ts +++ b/.vitepress/config/shared.ts @@ -1,7 +1,9 @@ -import { defineConfig } from 'vitepress' +import { defineConfigWithTheme } from 'vitepress' +import { type AMWTheme } from '../theme/types/index' import markdownTimeline from 'vitepress-markdown-timeline' import { tabsMarkdownPlugin as markdownItTabs } from 'vitepress-plugin-tabs' import markdownItTaskLists from 'markdown-it-task-lists' + import UnoCSS from 'unocss/vite' import { GitChangelog, @@ -9,9 +11,7 @@ import { } from '@nolebase/vitepress-plugin-git-changelog/vite' import { NolebaseGitChangelogOptions } from './plugins' -import { telegram } from '../data/icons' - -export const shared = defineConfig({ +export const shared = defineConfigWithTheme({ title: 'ALT Mobile Wiki', titleTemplate: ':title — ALT Mobile Wiki', srcDir: './docs', @@ -47,9 +47,7 @@ export const shared = defineConfig({ link: 'https://github.com/OlegShchavelev/ALTMobileWiki' }, { - icon: { - svg: telegram - }, + icon: 'telegram', link: 'https://t.me/altmobile_channel' } ], diff --git a/.vitepress/data/icons.ts b/.vitepress/data/icons.ts deleted file mode 100644 index dbbf18c..0000000 --- a/.vitepress/data/icons.ts +++ /dev/null @@ -1,34 +0,0 @@ -const telegram = ` -Telegram - - -` - -const gitflic = ` -Gitflic - - - - - -` - -const gitlab = `GitLab` -const vk = ` -VKontakte - - -` - -const messager = ` - - -` - -const gitverse = ` - - - -` - -export { telegram, gitflic, gitlab, vk, messager, gitverse } diff --git a/.vitepress/theme/index.ts b/.vitepress/theme/index.ts index 8274ebb..081bd05 100644 --- a/.vitepress/theme/index.ts +++ b/.vitepress/theme/index.ts @@ -24,6 +24,7 @@ import { enhanceAppWithTabs } from 'vitepress-plugin-tabs/client' import './styles/style.css' import './styles/theme.css' +import './styles/icons.css' import 'uno.css' import 'vitepress-markdown-timeline/dist/theme/index.css' diff --git a/.vitepress/theme/styles/icons.css b/.vitepress/theme/styles/icons.css new file mode 100644 index 0000000..75ff1d7 --- /dev/null +++ b/.vitepress/theme/styles/icons.css @@ -0,0 +1,12 @@ +/** +* Customize default theme styling by extends SVG icons +* See: +* - https://yoksel.github.io/url-encoder/ +* -------------------------------------------------------------------------- */ + +.vpi-social-telegram { + --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 0C18.6277 0 24 5.37235 24 12C24 18.6277 18.6277 24 12 24C5.37235 24 0 18.6277 0 12C0 5.37235 5.37235 0 12 0ZM16.1395 16.8913C16.3602 16.2141 17.3943 9.46487 17.5221 8.13496C17.5607 7.73217 17.4334 7.46452 17.184 7.34504C16.8824 7.2 16.4358 7.27252 15.9177 7.4593C15.2071 7.71548 6.12261 11.5727 5.59774 11.796C5.1 12.0073 4.62939 12.2379 4.62939 12.5718C4.62939 12.8066 4.7687 12.9386 5.1527 13.0758C5.55235 13.2183 6.55878 13.5235 7.15304 13.6873C7.72539 13.8454 8.37704 13.7082 8.74226 13.4812C9.12939 13.2407 13.597 10.2511 13.9179 9.98922C14.2383 9.7273 14.4939 10.0628 14.232 10.3252C13.9701 10.5871 10.9033 13.5637 10.499 13.9758C10.008 14.4762 10.3565 14.9948 10.6857 15.2024C11.0619 15.4393 13.7671 17.2539 14.1746 17.545C14.5821 17.8362 14.9953 17.9682 15.3736 17.9682C15.7518 17.9682 15.9511 17.4699 16.1395 16.8913Z'/%3E%3C/svg%3E"); +} +.vpi-social-gitflic { + --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9.80801 9.808C9.99201 9.732 10.104 9.608 10.14 9.472C10.176 9.336 10.144 9.168 10.024 9.012C9.90001 8.852 9.69601 8.712 9.44001 8.644C9.18401 8.572 8.93601 8.596 8.74801 8.668C8.56001 8.744 8.44801 8.868 8.41201 9.004C8.37601 9.14 8.40801 9.308 8.53201 9.464C8.65601 9.624 8.86001 9.764 9.11601 9.832C9.37601 9.904 9.62001 9.88 9.80801 9.808Z' /%3E%3Cpath d='M11.952 11.656C10.54 11.656 9.388 12.308 9.34 13.12C9.336 13.14 9.336 13.16 9.336 13.18C9.336 13.52 9.532 13.836 9.856 14.088C10.204 14.312 10.736 14.408 11.076 14.616C11.196 14.688 11.308 14.768 11.404 14.868C11.76 15.244 11.768 15.572 11.688 15.8C11.516 16.276 10.996 16.604 10.396 16.608C10.304 16.612 10.232 16.688 10.232 16.78C10.232 16.872 10.308 16.944 10.4 16.944C10.404 16.944 10.404 16.944 10.404 16.944C11.128 16.936 11.764 16.536 11.996 15.948C12.24 16.516 12.864 16.896 13.572 16.908C13.576 16.908 13.576 16.908 13.576 16.908C13.668 16.908 13.744 16.836 13.744 16.744C13.748 16.652 13.672 16.572 13.58 16.572C12.98 16.564 12.452 16.24 12.288 15.764C12.128 15.296 12.428 14.956 12.52 14.868C12.616 14.768 12.728 14.684 12.844 14.616C13.188 14.408 13.656 14.292 14.06 14.092C14.38 13.932 14.58 13.524 14.576 13.18C14.576 13.144 14.572 13.104 14.568 13.072C14.468 12.28 13.336 11.656 11.952 11.656Z' /%3E%3Cpath d='M19.972 0H4.028C1.804 0 0 1.804 0 4.028V19.968C0 22.196 1.804 24 4.028 24H19.968C22.192 24 23.996 22.196 23.996 19.972V4.028C24 1.804 22.196 0 19.972 0ZM17.84 17.412L17.824 17.428C17.66 17.6 17.488 17.764 17.308 17.92L14.308 20.776L13.56 20.048L11.96 21.88L10.396 20.092L9.692 20.78L6.7 17.928C6.512 17.768 6.336 17.596 6.164 17.42L6.156 17.412C4.824 16.016 4.004 14.136 4.004 12.076C4.004 10.408 4.54 8.86 5.448 7.592C4.936 7.084 4.624 6.376 4.64 5.6C4.668 4.104 5.924 2.896 7.42 2.924C8.508 2.944 9.44 3.6 9.86 4.536C10.54 4.348 11.256 4.252 11.996 4.252C12.74 4.252 13.456 4.348 14.14 4.536C14.576 3.556 15.58 2.88 16.732 2.92C18.112 2.972 19.248 4.064 19.352 5.44C19.416 6.28 19.092 7.048 18.544 7.592C19.452 8.86 19.988 10.408 19.988 12.072C19.992 14.128 19.176 16.008 17.84 17.412Z' /%3E%3Cpath d='M15.296 8.672C15.108 8.596 14.864 8.576 14.604 8.648C14.344 8.72 14.14 8.86 14.02 9.016C13.896 9.172 13.864 9.336 13.9 9.476C13.936 9.616 14.048 9.736 14.236 9.812C14.424 9.888 14.668 9.908 14.928 9.836C15.188 9.764 15.392 9.624 15.512 9.468C15.636 9.312 15.668 9.148 15.632 9.008C15.592 8.868 15.48 8.748 15.296 8.672Z'/%3E%3C/svg%3E"); +}