Compare commits

..

9 Commits
2.2.3 ... 2.2.5

Author SHA1 Message Date
00b63a5bea revert: release 2.2.5
All checks were successful
test-build / build (push) Successful in 2m29s
release-image-harbor / build (push) Successful in 1m23s
release-image-gitea / build (push) Successful in 2m39s
release-image-gitea / release (push) Successful in 5m45s
release-image-harbor / release (push) Successful in 7m49s
renovate / renovate (push) Successful in 4m11s
2026-02-01 21:50:36 -06:00
d9860106b1 chore(deps): update pnpm 2026-02-01 21:49:52 -06:00
83940a28ab Merge pull request 'chore(deps): update dependency shiki to v3.22.0' (#314) from renovate/shiki-monorepo into main
Some checks failed
renovate / renovate (push) Successful in 50s
test-build / build (push) Has been cancelled
Reviewed-on: #314
2026-02-02 03:48:48 +00:00
4baa2bed51 chore(deps): update dependency shiki to v3.22.0
Some checks failed
renovate/stability-days Updates have met minimum release age requirement
test-build / build (pull_request) Failing after 1m16s
2026-02-01 00:02:59 +00:00
19a9588919 Merge pull request 'chore(deps): update dependency preline to v4.0.1' (#313) from renovate/preline-4.x-lockfile into main
All checks were successful
test-build / build (push) Successful in 4m47s
renovate / renovate (push) Successful in 3m6s
2026-01-31 00:02:07 +00:00
3c8d3992cf chore(deps): update dependency preline to v4.0.1
Some checks are pending
renovate/stability-days Updates have not met minimum release age requirement
test-build / build (pull_request) Successful in 1m51s
2026-01-31 00:01:39 +00:00
fb8f642c52 fix: update lock
All checks were successful
renovate / renovate (push) Successful in 2m14s
test-build / build (push) Successful in 2m16s
release-image-harbor / build (push) Successful in 1m36s
release-image-gitea / build (push) Successful in 3m47s
release-image-harbor / release (push) Successful in 3m25s
release-image-gitea / release (push) Successful in 3m15s
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
5 changed files with 802 additions and 736 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.3"
LABEL version="2.2.5"
LABEL description="Astro based personal website"
EXPOSE $PORT

View File

@@ -1,7 +1,7 @@
{
"name": "site-profile",
"type": "module",
"version": "2.2.3",
"version": "2.2.5",
"homepage": "https://www.alexlebens.dev",
"bugs": {
"url": "https://gitea.alexlebens.dev/alexlebens/site-profile/issues",
@@ -38,7 +38,7 @@
"@giscus/react": "^3.1.0",
"@iconify-json/mdi": "^1.2.3",
"@iconify-json/pajamas": "^1.2.15",
"@iconify-json/simple-icons": "^1.2.68",
"@iconify-json/simple-icons": "^1.2.69",
"@playform/compress": "^0.2.1",
"@rehype-pretty/transformers": "^0.13.2",
"@swup/astro": "1.7.0",
@@ -49,21 +49,23 @@
"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",
"preline": "^4.0.1",
"react": "^19.2.4",
"react-dom": "^19.2.4",
"reading-time": "^1.5.0",
"rehype-pretty-code": "^0.14.1",
"sharp": "^0.34.5",
"sharp-ico": "^0.1.5",
"shiki": "^3.21.0",
"shiki": "^3.22.0",
"tailwindcss": "^4.1.18",
"ultrahtml": "^1.6.0"
},
"devDependencies": {
"@eslint-react/eslint-plugin": "^2.8.1",
"@eslint-react/eslint-plugin": "^2.8.4",
"@tailwindcss/forms": "^0.5.11",
"@tailwindcss/typography": "^0.5.19",
"astro-icon": "^1.1.5",

1478
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

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 */