Compare commits

...

4 Commits
2.2.2 ... main

Author SHA1 Message Date
fb8f642c52 fix: update lock
Some checks are pending
renovate / renovate (push) Waiting to run
test-build / build (push) Waiting to run
2026-01-30 17:59:51 -06:00
fde397386c revert: release 2.2.4
Some checks failed
test-build / build (push) Failing after 24s
renovate / renovate (push) Has been cancelled
2026-01-30 17:58:08 -06:00
b7f76c5847 feat: add shiki to markdown rendering for code highlighting 2026-01-30 17:56:57 -06:00
b3bb769c47 revert: release 2.2.3
All checks were successful
renovate / renovate (push) Successful in 1m12s
release-image-harbor / build (push) Successful in 1m50s
test-build / build (push) Successful in 2m19s
release-image-gitea / build (push) Successful in 2m15s
release-image-gitea / release (push) Successful in 3m1s
release-image-harbor / release (push) Successful in 7m1s
2026-01-29 19:09:10 -06:00
5 changed files with 73 additions and 3 deletions

View File

@@ -29,7 +29,7 @@ ENV SITE_URL=https://www.alexlebens.dev
ENV DIRECTUS_URL=https://directus.alexlebens.dev
ENV PORT=4321
LABEL version="2.2.2"
LABEL version="2.2.4"
LABEL description="Astro based personal website"
EXPOSE $PORT

View File

@@ -1,7 +1,7 @@
{
"name": "site-profile",
"type": "module",
"version": "2.2.2",
"version": "2.2.4",
"homepage": "https://www.alexlebens.dev",
"bugs": {
"url": "https://gitea.alexlebens.dev/alexlebens/site-profile/issues",
@@ -49,6 +49,8 @@
"astro": "^5.17.1",
"astro-compressor": "^1.2.0",
"astro-icon": "^1.1.5",
"marked": "^17.0.1",
"marked-shiki": "^1.2.1",
"mdast-util-to-string": "^4.0.0",
"motion": "^12.29.2",
"preline": "^4.0.0",

24
pnpm-lock.yaml generated
View File

@@ -74,6 +74,12 @@ importers:
astro-icon:
specifier: ^1.1.5
version: 1.1.5
marked:
specifier: ^17.0.1
version: 17.0.1
marked-shiki:
specifier: ^1.2.1
version: 1.2.1(marked@17.0.1)(shiki@3.21.0)
mdast-util-to-string:
specifier: ^4.0.0
version: 4.0.0
@@ -3730,6 +3736,17 @@ packages:
markdown-table@3.0.4:
resolution: {integrity: sha512-wiYz4+JrLyb/DqW2hkFJxP7Vd7JuTDm77fvbM8VfEQdmSMqcImWeeRbHwZjBjIFki/VaMK2BhFi7oUUZeM5bqw==}
marked-shiki@1.2.1:
resolution: {integrity: sha512-yHxYQhPY5oYaIRnROn98foKhuClark7M373/VpLxiy5TrDu9Jd/LsMwo8w+U91Up4oDb9IXFrP0N1MFRz8W/DQ==}
peerDependencies:
marked: '>=7.0.0'
shiki: '>=1.0.0'
marked@17.0.1:
resolution: {integrity: sha512-boeBdiS0ghpWcSwoNm/jJBwdpFaMnZWRzjA6SkUMYb40SVaN1x7mmfGKp0jvexGcx+7y2La5zRZsYFZI6Qpypg==}
engines: {node: '>= 20'}
hasBin: true
math-intrinsics@1.1.0:
resolution: {integrity: sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==}
engines: {node: '>= 0.4'}
@@ -10070,6 +10087,13 @@ snapshots:
markdown-table@3.0.4: {}
marked-shiki@1.2.1(marked@17.0.1)(shiki@3.21.0):
dependencies:
marked: 17.0.1
shiki: 3.21.0
marked@17.0.1: {}
math-intrinsics@1.1.0: {}
maxmin@2.1.0:

View File

@@ -4,6 +4,9 @@ import getReadingTime from 'reading-time';
import { readItems, readSingleton } from '@directus/sdk';
import directus from '@lib/directus';
import { marked } from 'marked';
import markedShiki from 'marked-shiki';
import { createHighlighter } from 'shiki';
import { getDirectusImageURL } from '@lib/directusFunctions';
import BaseLayout from '@layouts/BaseLayout.astro';
import Image from '@components/ui/images/Image.astro';
@@ -23,6 +26,24 @@ const category: CollectionEntry<'categories'> = (await getCollection('categories
.filter((c) => c.slug === post.category)
.pop() as CollectionEntry<'categories'>;
const readingTime = getReadingTime(post.content);
const highlighter = await createHighlighter({
themes: ['github-light', 'github-dark', 'monokai'],
langs: ['typescript', 'python', 'css', 'html', 'yaml', 'bash', 'json'],
});
marked.use(markedShiki({
highlight(code, lang) {
return highlighter.codeToHtml(code, {
lang: lang || 'plaintext',
themes: {
light: 'github-light',
dark: 'github-dark',
},
defaultColor: false,
});
}
}));
const content = marked.parse(post.content);
---
<BaseLayout
@@ -126,7 +147,7 @@ const readingTime = getReadingTime(post.content);
<article
class="prose prose-blog sm:prose-lg dark:prose-invert max-w-none text-justify text-neutral-800 dark:text-neutral-200"
>
<div set:html={post.content} />
<div set:html={content} />
</article>
<div

View File

@@ -60,6 +60,29 @@
color var(--theme-transition),
border-color var(--theme-transition);
}
:root {
--shiki-fg: var(--shiki-light);
--shiki-bg: var(--color-neutral-200);
}
.dark {
--shiki-fg: var(--shiki-dark);
--shiki-bg: var(--color-neutral-800);
}
pre.shiki {
background-color: var(--shiki-bg) !important;
color: var(--shiki-fg) !important;
}
pre.shiki span {
color: var(--shiki-light);
}
.dark pre.shiki span {
color: var(--shiki-dark) !important;
}
}
/* Content reveal animations */