|
| 1 | +--- |
| 2 | +import Layout from '../layouts/Layout.astro' |
| 3 | +import Header from '../components/Header.astro' |
| 4 | +import Footer from '../components/Footer.astro' |
| 5 | +import { marked } from 'marked' |
| 6 | +import fs from 'node:fs' |
| 7 | +import path from 'node:path' |
| 8 | +
|
| 9 | +// Read the changelog file at build time |
| 10 | +const changelogPath = path.resolve(import.meta.dirname, '../../../../CHANGELOG.md') |
| 11 | +const changelogContent = fs.readFileSync(changelogPath, 'utf-8') |
| 12 | +
|
| 13 | +// Parse markdown to HTML |
| 14 | +const htmlContent = await marked.parse(changelogContent) |
| 15 | +--- |
| 16 | + |
| 17 | +<Layout title="Changelog - Cmdr" description="See what's new in Cmdr. All notable changes documented here."> |
| 18 | + <Header /> |
| 19 | + <main class="mx-auto max-w-4xl px-6 pt-32 pb-24"> |
| 20 | + <header class="mb-12"> |
| 21 | + <h1 class="mb-4 text-4xl font-bold tracking-tight text-[var(--color-text-primary)]">Changelog</h1> |
| 22 | + <p class="text-[var(--color-text-secondary)]"> |
| 23 | + All notable changes to Cmdr are documented here. The format is based on |
| 24 | + <a |
| 25 | + href="https://keepachangelog.com/en/1.1.0/" |
| 26 | + target="_blank" |
| 27 | + rel="noopener noreferrer" |
| 28 | + class="text-[var(--color-accent)] underline underline-offset-2 hover:text-[var(--color-accent-hover)]" |
| 29 | + >keep a changelog</a |
| 30 | + >. |
| 31 | + </p> |
| 32 | + </header> |
| 33 | + |
| 34 | + <article class="changelog-content" set:html={htmlContent} /> |
| 35 | + </main> |
| 36 | + <Footer /> |
| 37 | +</Layout> |
| 38 | + |
| 39 | +<style> |
| 40 | + .changelog-content { |
| 41 | + font-family: var(--font-mono) monospace; |
| 42 | + font-size: 0.875rem; |
| 43 | + line-height: 1.75; |
| 44 | + } |
| 45 | + |
| 46 | + /* Hide the title and intro from the markdown since we render them manually */ |
| 47 | + .changelog-content :global(h1:first-child), |
| 48 | + .changelog-content :global(h1:first-child + p) { |
| 49 | + display: none; |
| 50 | + } |
| 51 | + |
| 52 | + .changelog-content :global(h2) { |
| 53 | + margin-top: 3rem; |
| 54 | + margin-bottom: 1rem; |
| 55 | + padding-bottom: 0.5rem; |
| 56 | + border-bottom: 1px solid var(--color-border); |
| 57 | + font-size: 1.25rem; |
| 58 | + font-weight: 600; |
| 59 | + color: var(--color-accent); |
| 60 | + } |
| 61 | + |
| 62 | + .changelog-content :global(h2:first-of-type) { |
| 63 | + margin-top: 0; |
| 64 | + } |
| 65 | + |
| 66 | + .changelog-content :global(h3) { |
| 67 | + margin-top: 1.5rem; |
| 68 | + margin-bottom: 0.75rem; |
| 69 | + font-size: 1rem; |
| 70 | + font-weight: 600; |
| 71 | + color: var(--color-text-primary); |
| 72 | + } |
| 73 | + |
| 74 | + .changelog-content :global(h4) { |
| 75 | + margin-top: 1.25rem; |
| 76 | + margin-bottom: 0.5rem; |
| 77 | + font-size: 0.875rem; |
| 78 | + font-weight: 600; |
| 79 | + color: var(--color-text-secondary); |
| 80 | + } |
| 81 | + |
| 82 | + .changelog-content :global(p) { |
| 83 | + margin-bottom: 1rem; |
| 84 | + color: var(--color-text-secondary); |
| 85 | + } |
| 86 | + |
| 87 | + .changelog-content :global(ul) { |
| 88 | + margin-bottom: 1rem; |
| 89 | + padding-left: 1.5rem; |
| 90 | + list-style-type: disc; |
| 91 | + } |
| 92 | + |
| 93 | + .changelog-content :global(li) { |
| 94 | + margin-bottom: 0.5rem; |
| 95 | + color: var(--color-text-secondary); |
| 96 | + } |
| 97 | + |
| 98 | + .changelog-content :global(a) { |
| 99 | + color: var(--color-accent); |
| 100 | + text-decoration: underline; |
| 101 | + text-underline-offset: 2px; |
| 102 | + transition: color 0.2s; |
| 103 | + } |
| 104 | + |
| 105 | + .changelog-content :global(a:hover) { |
| 106 | + color: var(--color-accent-hover); |
| 107 | + } |
| 108 | + |
| 109 | + .changelog-content :global(strong) { |
| 110 | + color: var(--color-text-primary); |
| 111 | + font-weight: 600; |
| 112 | + } |
| 113 | + |
| 114 | + .changelog-content :global(code) { |
| 115 | + padding: 0.125rem 0.375rem; |
| 116 | + background: var(--color-surface); |
| 117 | + border-radius: 0.25rem; |
| 118 | + font-size: 0.875em; |
| 119 | + } |
| 120 | + |
| 121 | + .changelog-content :global(hr) { |
| 122 | + margin: 2rem 0; |
| 123 | + border: none; |
| 124 | + border-top: 1px solid var(--color-border); |
| 125 | + } |
| 126 | + |
| 127 | + /* Collapsible details/summary styling */ |
| 128 | + .changelog-content :global(details) { |
| 129 | + margin-top: 2rem; |
| 130 | + padding: 1rem 1.5rem; |
| 131 | + background: var(--color-surface); |
| 132 | + border: 1px solid var(--color-border); |
| 133 | + border-radius: 0.75rem; |
| 134 | + } |
| 135 | + |
| 136 | + .changelog-content :global(summary) { |
| 137 | + cursor: pointer; |
| 138 | + font-weight: 600; |
| 139 | + color: var(--color-text-primary); |
| 140 | + } |
| 141 | + |
| 142 | + .changelog-content :global(summary:hover) { |
| 143 | + color: var(--color-accent); |
| 144 | + } |
| 145 | + |
| 146 | + .changelog-content :global(details[open] summary) { |
| 147 | + margin-bottom: 1rem; |
| 148 | + } |
| 149 | +</style> |
0 commit comments