From 2363b9a9010a0508a021fb9e7e135efd9cbfbad6 Mon Sep 17 00:00:00 2001 From: Ivan Kuzmenko <6745157+rndtrash@users.noreply.github.com> Date: Mon, 29 Sep 2025 22:59:13 +0300 Subject: [PATCH 1/5] =?UTF-8?q?=D0=A1=D0=B4=D0=B5=D0=BB=D0=B0=D0=BB=20?= =?UTF-8?q?=D0=B1=D0=BB=D0=BE=D0=BA=20=D0=BF=D1=80=D0=B5=D0=B4=D1=83=D0=BF?= =?UTF-8?q?=D1=80=D0=B5=D0=B6=D0=B4=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=B1=D0=BE?= =?UTF-8?q?=D0=BB=D0=B5=D0=B5=20=D0=B6=D1=91=D0=BB=D1=82=D1=8B=D0=BC,=20?= =?UTF-8?q?=D0=BF=D0=BE=D1=82=D0=BE=D0=BC=D1=83=20=D1=87=D1=82=D0=BE=20?= =?UTF-8?q?=D0=BC=D0=BE=D0=B3=D1=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lib/components/WarningBlock.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/components/WarningBlock.svelte b/src/lib/components/WarningBlock.svelte index e76765c..50c9cf5 100644 --- a/src/lib/components/WarningBlock.svelte +++ b/src/lib/components/WarningBlock.svelte @@ -3,8 +3,8 @@ From 632620484d754d9ea5eb44db1ffbdb59d1b749c2 Mon Sep 17 00:00:00 2001 From: Ivan Kuzmenko <6745157+rndtrash@users.noreply.github.com> Date: Tue, 30 Sep 2025 00:22:30 +0300 Subject: [PATCH 2/5] =?UTF-8?q?=D0=91=D0=BE=D0=BB=D0=B5=D0=B5=20=D0=BA?= =?UTF-8?q?=D0=BE=D0=BD=D1=81=D0=B8=D1=81=D1=82=D0=B5=D0=BD=D1=82=D0=BD?= =?UTF-8?q?=D1=8B=D0=B9=20=D1=81=D1=82=D0=B8=D0=BB=D1=8C=20=D1=82=D0=B5?= =?UTF-8?q?=D0=BA=D1=81=D1=82=D0=B0=20=D0=B2=20=D0=B1=D0=BB=D0=BE=D0=B3?= =?UTF-8?q?=D0=B0=D1=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/routes/blog/[slug]/+page.svelte | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/routes/blog/[slug]/+page.svelte b/src/routes/blog/[slug]/+page.svelte index b143f3e..4679b12 100644 --- a/src/routes/blog/[slug]/+page.svelte +++ b/src/routes/blog/[slug]/+page.svelte @@ -72,18 +72,17 @@
From 9722448c3663f01591b911970f3f0bef08eaf0a2 Mon Sep 17 00:00:00 2001 From: Ivan Kuzmenko <6745157+rndtrash@users.noreply.github.com> Date: Tue, 30 Sep 2025 00:23:29 +0300 Subject: [PATCH 3/5] =?UTF-8?q?=D0=9F=D0=B5=D1=80=D0=B5=D1=80=D0=B0=D0=B1?= =?UTF-8?q?=D0=BE=D1=82=D0=B0=D0=BB=20HoverIcon,=20=D1=87=D1=82=D0=BE?= =?UTF-8?q?=D0=B1=D1=8B=20=D0=B5=D0=B3=D0=BE=20=D0=BC=D0=BE=D0=B6=D0=BD?= =?UTF-8?q?=D0=BE=20=D0=B1=D1=8B=D0=BB=D0=BE=20=D0=B8=D1=81=D0=BF=D0=BE?= =?UTF-8?q?=D0=BB=D1=8C=D0=B7=D0=BE=D0=B2=D0=B0=D1=82=D1=8C=20=D0=B2=20

?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lib/components/HoverIcon.svelte | 30 ++++++++++++++--------- src/lib/components/NavBar.svelte | 2 +- src/lib/components/SocialButton.svelte | 2 +- src/lib/components/SocialHyperlink.svelte | 4 +-- 4 files changed, 22 insertions(+), 16 deletions(-) diff --git a/src/lib/components/HoverIcon.svelte b/src/lib/components/HoverIcon.svelte index 7fbff3c..58d0bc0 100644 --- a/src/lib/components/HoverIcon.svelte +++ b/src/lib/components/HoverIcon.svelte @@ -4,29 +4,35 @@ let className: string = ''; export { className as class }; export let src: string | null = null; - export let text: string; + export let alt: string | undefined = undefined; export let size: number = 32; export let black: boolean = false; - let isUrl; - $: isUrl = src?.startsWith('/') || src?.startsWith('http'); + function isUrl(src?: string) { + return src?.startsWith('/') || src?.startsWith('http'); + } -

+ {#if src} - {#if isUrl} - {text} + {#if isUrl(src)} + {:else} {/if} {:else} - {text} + {alt ?? 'Без иконки'} {/if} -
+ diff --git a/src/lib/components/NavBar.svelte b/src/lib/components/NavBar.svelte index 3316ee0..84e5596 100644 --- a/src/lib/components/NavBar.svelte +++ b/src/lib/components/NavBar.svelte @@ -20,7 +20,7 @@ diff --git a/src/lib/components/SocialButton.svelte b/src/lib/components/SocialButton.svelte index f12be28..b18df8b 100644 --- a/src/lib/components/SocialButton.svelte +++ b/src/lib/components/SocialButton.svelte @@ -14,7 +14,7 @@ target={isLinkLocal(href) ? '_self' : '_blank'} >
- +
= 40rem', false); - + - + From d30ab1b8d0d560710e508a4b08aef4bd030259b8 Mon Sep 17 00:00:00 2001 From: Ivan Kuzmenko <6745157+rndtrash@users.noreply.github.com> Date: Tue, 30 Sep 2025 00:24:03 +0300 Subject: [PATCH 4/5] =?UTF-8?q?=D0=97=D0=B0=D0=BC=D0=B5=D0=BD=D0=B8=D0=BB?= =?UTF-8?q?=20=D1=81=D1=81=D1=8B=D0=BB=D0=BA=D0=B8=20=D0=B2=20Md-=D0=B1?= =?UTF-8?q?=D0=BB=D0=BE=D0=B3=D0=B0=D1=85=20=D0=BD=D0=B0=20SocialHyperlink?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mdsvex.config.js | 3 --- src/lib/components/MdsvexLayout.svelte | 11 +++++++++++ svelte.config.js | 12 ++++++++++-- 3 files changed, 21 insertions(+), 5 deletions(-) delete mode 100644 mdsvex.config.js create mode 100644 src/lib/components/MdsvexLayout.svelte diff --git a/mdsvex.config.js b/mdsvex.config.js deleted file mode 100644 index 5576a98..0000000 --- a/mdsvex.config.js +++ /dev/null @@ -1,3 +0,0 @@ -export default { - extensions: ['.md'] -}; diff --git a/src/lib/components/MdsvexLayout.svelte b/src/lib/components/MdsvexLayout.svelte new file mode 100644 index 0000000..061e2b2 --- /dev/null +++ b/src/lib/components/MdsvexLayout.svelte @@ -0,0 +1,11 @@ + + + + +{@render children()} diff --git a/svelte.config.js b/svelte.config.js index ebf0dc8..8bcc2c3 100644 --- a/svelte.config.js +++ b/svelte.config.js @@ -1,8 +1,13 @@ import adapter from '@sveltejs/adapter-static'; import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'; import { mdsvex } from 'mdsvex'; -import mdsvexConfig from './mdsvex.config.js'; import autoImport from 'sveltekit-autoimport'; +import { join, dirname } from 'path'; +import { fileURLToPath } from 'url'; + +// https://flaviocopes.com/fix-dirname-not-defined-es-module-scope/ +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); /** @type {import('@sveltejs/kit').Config} */ const config = { @@ -34,7 +39,10 @@ const config = { extensions: ['.svelte', '.md'], preprocess: [ vitePreprocess(), - mdsvex(mdsvexConfig), + mdsvex({ + extensions: ['.md'], + layout: join(__dirname, "./src/lib/components/MdsvexLayout.svelte") + }), autoImport({ include: ['**/*.(svelte|md)'], components: ['./src/lib/components/', { name: './src' }] From 3cecfc1cc4a1c14d1924076b5895a4dec6635dbc Mon Sep 17 00:00:00 2001 From: Ivan Kuzmenko <6745157+rndtrash@users.noreply.github.com> Date: Tue, 30 Sep 2025 00:25:17 +0300 Subject: [PATCH 5/5] =?UTF-8?q?=D0=92=D1=80=D0=B5=D0=BC=D0=B5=D0=BD=D0=BD?= =?UTF-8?q?=D0=BE=20=D1=83=D0=B1=D1=80=D0=B0=D0=BB=20=D1=87=D0=B0=D1=88?= =?UTF-8?q?=D0=BA=D0=B8=20=D1=83=20=D1=81=D1=81=D1=8B=D0=BB=D0=BE=D0=BA=20?= =?UTF-8?q?=D1=81=20=D0=B8=D0=BA=D0=BE=D0=BD=D0=BA=D0=BE=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lib/util/LinkResolver.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lib/util/LinkResolver.ts b/src/lib/util/LinkResolver.ts index 23e1814..b942ba1 100644 --- a/src/lib/util/LinkResolver.ts +++ b/src/lib/util/LinkResolver.ts @@ -1,3 +1,4 @@ +// TODO: чашки на иконках выглядят страшненько, пока что пусть лучше будет голая ссылка const icons: Record = { none: 'material-symbols:link', 'steamcommunity.com': 'simple-icons:steam', @@ -12,10 +13,10 @@ const icons: Record = { 'bsky.social': 'simple-icons:bluesky', // https://хамяк.рф 'xn--80auf8a2c.xn--p1ai': 'fluent-emoji-high-contrast:hamster', - 'teasanctuary.ru': '/icons/tea-sanctuary-white.svg', + // 'teasanctuary.ru': '/icons/tea-sanctuary-white.svg', 'hl.teasanctuary.ru': '/icons/half-life.svg', 'git.teasanctuary.ru': 'devicon-plain:git', - localhost: '/icons/tea-sanctuary-white.svg', + // localhost: '/icons/tea-sanctuary-white.svg', email: 'material-symbols:alternate-email', rss: 'material-symbols:rss-feed' };