feat: add markdown update history
Publish GitHub Pages output / publish (push) Successful in 40s

This commit is contained in:
2026-08-31 14:17:49 +09:00
parent c01a3e534b
commit b48a3b4f9d
7 changed files with 155 additions and 12 deletions
+23 -11
View File
@@ -1,12 +1,14 @@
<script lang="ts">
import { onMount } from 'svelte';
import { dev } from '$app/environment';
import updateHistoryMarkdown from '../../../UPDATES.md?raw';
import { renderReleaseMarkdown } from '$lib/release-notes/markdown';
import { RELEASES_PAGE_URL } from '$lib/release-notes/release-note-service';
import { currentAppVersion, releaseNotes } from '$lib/release-notes/release-note-store';
import { versionTagIsNewer } from '$lib/release-notes/version';
import { parseUpdateHistoryDocument } from '$lib/update-history-document.ts';
let previewUpdate = false;
const updateHistoryDocument = parseUpdateHistoryDocument(updateHistoryMarkdown);
onMount(() => {
previewUpdate = dev && new URLSearchParams(window.location.search).get('previewUpdate') === '1';
@@ -16,6 +18,20 @@
$: latestRelease = $releaseNotes.releases[0] ?? null;
$: updateAvailable = latestRelease !== null && (previewUpdate || versionTagIsNewer(latestRelease.tagName, currentAppVersion));
function updatedDateTime(value: string | null): string {
if (!value) return '시각 미등록';
const date = new Date(value);
if (Number.isNaN(date.getTime())) return value;
return new Intl.DateTimeFormat('ko-KR', {
year: 'numeric',
month: 'long',
day: 'numeric',
hour: '2-digit',
minute: '2-digit',
hour12: false
}).format(date);
}
function publishedDate(value: string): string {
const date = new Date(value);
if (Number.isNaN(date.getTime())) return value;
@@ -27,25 +43,22 @@
}
</script>
{#if $releaseNotes.status === 'available' && latestRelease}
<aside class:available={updateAvailable} class="update-notice" aria-live="polite">
<aside class:available={updateAvailable} class="update-notice" aria-live="polite">
<div class="notice-header">
<div class="version-summary">
<span class="label">현재 버전</span>
<strong>v{currentAppVersion.replace(/^v/i, '')}</strong>
<span class="label">최근 업데이트</span>
<strong><time datetime={updateHistoryDocument.updatedAt ?? undefined}>{updatedDateTime(updateHistoryDocument.updatedAt)}</time></strong>
{#if previewUpdate}
<span class="status"><b>업데이트 알림 미리보기</b></span>
{:else if updateAvailable}
<span class="status"><b>{latestRelease.tagName}</b> 업데이트를 사용할 수 있습니다.</span>
{:else}
<span class="status">최신 버전입니다.</span>
{/if}
</div>
<a class="action" href={RELEASES_PAGE_URL} target="_blank" rel="noreferrer">업데이트 내역 확인 <span aria-hidden="true">→</span></a>
<a class="action" href="/updates">업데이트 내역 확인 <span aria-hidden="true">→</span></a>
</div>
{#if updateAvailable}
{#if updateAvailable && latestRelease}
<section class="latest-note" aria-labelledby="latest-release-title">
<header>
<div>
@@ -62,8 +75,7 @@
{/if}
</section>
{/if}
</aside>
{/if}
</aside>
<style>
.update-notice { margin-bottom: 12px; border: 1px solid #2c3440; border-radius: 12px; background: #151a22; overflow: hidden; }