From 3cb6939d652e75d05c8250fe9c1125a8b787feaa Mon Sep 17 00:00:00 2001 From: pheralb Date: Tue, 23 Jul 2024 14:00:26 +0100 Subject: [PATCH] feat: featured projects, post & /post page design improvements --- mdsvex.options.js | 10 ++++++++- src/components/featuredProjects.svelte | 3 ++- src/components/posts.svelte | 29 ++++++++++++++++++++------ src/routes/post/[slug]/+page.svelte | 4 ++-- 4 files changed, 36 insertions(+), 10 deletions(-) diff --git a/mdsvex.options.js b/mdsvex.options.js index d481dcd..3f651ff 100644 --- a/mdsvex.options.js +++ b/mdsvex.options.js @@ -57,7 +57,15 @@ export const mdsvexOptions = { rehypePlugins: [ [urls, processUrl], rehypeSlug, - rehypeAutolinkHeadings, + [ + rehypeAutolinkHeadings, + { + behavior: 'wrap', + properties: { + className: `before:content-['#'] before:absolute before:-ml-[1em] before:text-neutral-100/0 dark:hover:before:text-neutral-200/50 hover:before:text-neutral-900/50 pl-[1em] -ml-[1em]` + } + } + ], [rehypeToc, { customizeTOC }] ], highlight: { diff --git a/src/components/featuredProjects.svelte b/src/components/featuredProjects.svelte index e491d76..9769b08 100644 --- a/src/components/featuredProjects.svelte +++ b/src/components/featuredProjects.svelte @@ -1,6 +1,7 @@ @@ -9,7 +10,7 @@

Projects

More @@ -13,7 +15,7 @@
{post.title} @@ -21,11 +23,26 @@ {post.description}

-
- {post.category} -

- {formatDate(post.date)} -

+
+
+ + + {post.category} + + + + + +
+ + Read more + +
{/each} diff --git a/src/routes/post/[slug]/+page.svelte b/src/routes/post/[slug]/+page.svelte index 47312f4..54c97f5 100644 --- a/src/routes/post/[slug]/+page.svelte +++ b/src/routes/post/[slug]/+page.svelte @@ -1,6 +1,6 @@