feat: lucide icon and latex formulas

This commit is contained in:
2026-04-25 17:04:31 +02:00
parent d1b44ad53e
commit 7268933a17
12 changed files with 78 additions and 21 deletions
+5 -8
View File
@@ -1,13 +1,13 @@
<script setup lang="ts">
import type { Article } from '@interfaces'
import { ref, onBeforeMount, onUpdated } from 'vue'
import { ref, onBeforeMount } from 'vue'
import { loadArticle } from '@lib/articles'
import { useRoute, onBeforeRouteUpdate, type RouteLocation } from 'vue-router'
import NotFoundView from './NotFoundView.vue'
import { dateFromParts, simpleDateFormat } from '@lib/dates'
import { SIGNATURE, TITLE } from '@lib/meta'
import PageFooter from '@components/PageFooter.vue'
import hljs from 'highlight.js'
import { stripHTML } from '@/lib/strings'
const article = ref<Article | null>(null)
const loading = ref<boolean>(true)
@@ -22,16 +22,13 @@ async function loadPage(target: RouteLocation) {
target.params.day as string,
),
)
window.document.title = TITLE + ' — ' + (article.value?.metadata.title ?? 'Not Found')
window.document.title =
stripHTML(TITLE) + ' — ' + stripHTML(article.value?.metadata.title ?? 'Not Found')
loading.value = false
}
onBeforeMount(() => loadPage(route))
onBeforeRouteUpdate(loadPage)
onUpdated(() => {
hljs.highlightAll()
})
</script>
<template>
@@ -45,7 +42,7 @@ onUpdated(() => {
<main class="article">
<div class="header">
<RouterLink class="link-home" to="/"></RouterLink>
<h1>{{ article.metadata.title }}</h1>
<h1 v-html="article.metadata.title"></h1>
<span class="time">
<span>{{ article.metadata.draft ? 'Drafted on' : 'Published on' }}</span>
{{ simpleDateFormat(article.metadata.date) }}