Заменил ссылки в Md-блогах на SocialHyperlink

This commit is contained in:
Иван Кузьменко 2025-09-30 00:24:03 +03:00
parent 9722448c36
commit d30ab1b8d0
3 changed files with 21 additions and 5 deletions

View file

@ -1,3 +0,0 @@
export default {
extensions: ['.md']
};

View file

@ -0,0 +1,11 @@
<script lang="ts" module>
import SocialHyperlink from './SocialHyperlink.svelte';
export { SocialHyperlink as a };
</script>
<script lang="ts">
const { children, ...rest } = $props();
</script>
{@render children()}

View file

@ -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' }]