fontisan 0.4.54-java → 0.4.55-java
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Cargo.lock +1 -1
- data/docs/.gitignore +4 -0
- data/docs/astro.config.mjs +16 -0
- data/docs/package-lock.json +4022 -1496
- data/docs/package.json +12 -5
- data/docs/scripts/sitemap-base.mjs +81 -0
- data/docs/src/content.config.ts +32 -0
- data/docs/{.vitepress/config.ts → src/data/sidebar.ts} +235 -146
- data/docs/src/layouts/Site.astro +320 -0
- data/docs/src/pages/404.astro +14 -0
- data/docs/src/pages/api/[...slug].astro +22 -0
- data/docs/src/pages/api/index.astro +12 -0
- data/docs/src/pages/cli/[...slug].astro +22 -0
- data/docs/src/pages/cli/index.astro +12 -0
- data/docs/src/pages/guide/[...slug].astro +22 -0
- data/docs/src/pages/guide/index.astro +12 -0
- data/docs/src/pages/history/[...slug].astro +22 -0
- data/docs/src/pages/history/index.astro +24 -0
- data/docs/src/pages/index.astro +234 -0
- data/docs/src/pages/root/[...slug].astro +20 -0
- data/docs/src/styles/site.css +88 -0
- data/lib/fontisan/byte_ops.rb +0 -5
- data/lib/fontisan/ffi/darwin-arm64/libfontisan_cdylib.dylib +0 -0
- data/lib/fontisan/ffi/darwin-x86_64/libfontisan_cdylib.dylib +0 -0
- data/lib/fontisan/ffi/linux-x86_64/libfontisan_cdylib.so +0 -0
- data/lib/fontisan/ffi/windows-x86_64/fontisan_cdylib.dll +0 -0
- data/lib/fontisan/native.rb +1 -1
- data/lib/fontisan/version.rb +1 -1
- metadata +18 -10
- data/docs/.vitepress/theme/components/ApiMethod.vue +0 -127
- data/docs/.vitepress/theme/components/Badge.vue +0 -51
- data/docs/.vitepress/theme/components/FeatureComparison.vue +0 -87
- data/docs/.vitepress/theme/components/HeroCodeBlock.vue +0 -98
- data/docs/.vitepress/theme/components/WithinHero.vue +0 -30
- data/docs/.vitepress/theme/index.ts +0 -22
- data/docs/.vitepress/theme/style.css +0 -628
- data/docs/scripts/post-build.mjs +0 -81
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
---
|
|
2
|
+
import "../styles/site.css";
|
|
3
|
+
import { SIDEBAR } from "../data/sidebar";
|
|
4
|
+
|
|
5
|
+
const { pathname } = Astro.url;
|
|
6
|
+
const base = import.meta.env.BASE_URL.replace(/\/$/, "");
|
|
7
|
+
const path = pathname.replace(import.meta.env.BASE_URL, "/").replace(/^\//, "").replace(/\/$/, "");
|
|
8
|
+
|
|
9
|
+
const sidebarKey = Object.keys(SIDEBAR).find((k) => path.startsWith(k.replace(/^\//, "").replace(/\/$/, "")));
|
|
10
|
+
const sidebar = sidebarKey ? SIDEBAR[sidebarKey] : [];
|
|
11
|
+
|
|
12
|
+
// Header search index over section pages.
|
|
13
|
+
import { getCollection } from "astro:content";
|
|
14
|
+
const [guideEntries, cliEntries, apiEntries] = await Promise.all([
|
|
15
|
+
getCollection("guide"),
|
|
16
|
+
getCollection("cli"),
|
|
17
|
+
getCollection("api"),
|
|
18
|
+
]);
|
|
19
|
+
const titleOf = (e) => e.data?.title ?? e.body?.match(/^# (.+)$/m)?.[1] ?? e.id;
|
|
20
|
+
const searchEntries = [
|
|
21
|
+
...guideEntries.map((e) => ({ title: titleOf(e), url: `/guide/${e.id === "index" ? "" : e.id}`, section: "Guide" })),
|
|
22
|
+
...cliEntries.map((e) => ({ title: titleOf(e), url: `/cli/${e.id === "index" ? "" : e.id}`, section: "CLI" })),
|
|
23
|
+
...apiEntries.map((e) => ({ title: titleOf(e), url: `/api/${e.id === "index" ? "" : e.id}`, section: "API" })),
|
|
24
|
+
];
|
|
25
|
+
const isHome = path === "";
|
|
26
|
+
---
|
|
27
|
+
<!doctype html>
|
|
28
|
+
<html lang="en-US">
|
|
29
|
+
<head>
|
|
30
|
+
<meta charset="utf-8" />
|
|
31
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
32
|
+
<title>{Astro.props.title ?? "Fontisan"}</title>
|
|
33
|
+
<meta name="description" content={Astro.props.description ?? "The most comprehensive font processing library for Ruby — 100% Pure Ruby."} />
|
|
34
|
+
<meta property="og:title" content={Astro.props.title ?? "Fontisan"} />
|
|
35
|
+
<meta property="og:description" content={Astro.props.description ?? "100% Pure Ruby font processing."} />
|
|
36
|
+
<meta property="og:image" content={`${base}/og-image.png`} />
|
|
37
|
+
<meta name="twitter:card" content="summary_large_image" />
|
|
38
|
+
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
39
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
40
|
+
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Spectral:ital,opsz,wght@0,7..72,200..800;1,7..72,200..800&family=IBM+Plex+Mono:wght@400;500&family=IBM+Plex+Sans:wght@300;400;500;600&display=swap" />
|
|
41
|
+
<link rel="icon" type="image/svg+xml" href={`${base}/favicon.svg`} />
|
|
42
|
+
<link rel="icon" type="image/png" sizes="96x96" href={`${base}/favicon-96x96.png`} />
|
|
43
|
+
<link rel="shortcut icon" href={`${base}/favicon.ico`} />
|
|
44
|
+
<link rel="apple-touch-icon" sizes="180x180" href={`${base}/apple-touch-icon.png`} />
|
|
45
|
+
<script is:inline>
|
|
46
|
+
const saved = localStorage.getItem("fontisan-theme");
|
|
47
|
+
if (saved === "dark" || (saved === null && matchMedia("(prefers-color-scheme: dark)").matches)) {
|
|
48
|
+
document.documentElement.classList.add("dark");
|
|
49
|
+
}
|
|
50
|
+
</script>
|
|
51
|
+
</head>
|
|
52
|
+
<body>
|
|
53
|
+
{
|
|
54
|
+
!isHome && (
|
|
55
|
+
<header class="site-header">
|
|
56
|
+
<div class="site-header-inner">
|
|
57
|
+
<a href={`${base}/`} class="site-logo">
|
|
58
|
+
<img src={`${base}/logo-full.svg`} alt="Fontisan" />
|
|
59
|
+
</a>
|
|
60
|
+
<nav class="site-nav">
|
|
61
|
+
<a href="https://www.fontist.org">← Fontist.org</a>
|
|
62
|
+
<a href={`${base}/guide/`} class:list={{ active: path.startsWith("guide") }}>Guide</a>
|
|
63
|
+
<a href={`${base}/cli/`} class:list={{ active: path.startsWith("cli") }}>CLI</a>
|
|
64
|
+
<a href={`${base}/api/`} class:list={{ active: path.startsWith("api") }}>API</a>
|
|
65
|
+
<a href="https://www.fontist.org/fontist/">Fontist</a>
|
|
66
|
+
<a href="https://www.fontist.org/formulas/">Formulas</a>
|
|
67
|
+
</nav>
|
|
68
|
+
<div class="header-search" id="header-search">
|
|
69
|
+
<input
|
|
70
|
+
type="search"
|
|
71
|
+
id="header-search-input"
|
|
72
|
+
placeholder="Search docs…"
|
|
73
|
+
autocomplete="off"
|
|
74
|
+
data-entries={JSON.stringify(searchEntries)}
|
|
75
|
+
data-base={base}
|
|
76
|
+
/>
|
|
77
|
+
<div class="header-search-results" id="header-search-results" hidden />
|
|
78
|
+
</div>
|
|
79
|
+
<button id="theme-toggle" class="theme-toggle" aria-label="Toggle dark mode" title="Toggle dark mode">
|
|
80
|
+
<span class="theme-toggle-sun">☀</span>
|
|
81
|
+
<span class="theme-toggle-moon">☾</span>
|
|
82
|
+
</button>
|
|
83
|
+
</div>
|
|
84
|
+
</header>
|
|
85
|
+
)
|
|
86
|
+
}
|
|
87
|
+
<main class:list={["site-main", { "with-sidebar": sidebar.length > 0 }]}>
|
|
88
|
+
{
|
|
89
|
+
sidebar.length > 0 && (
|
|
90
|
+
<aside class="site-sidebar">
|
|
91
|
+
{sidebar.map((group) => (
|
|
92
|
+
<div class="sidebar-group">
|
|
93
|
+
<div class="sidebar-heading">{group.text}</div>
|
|
94
|
+
<ul>
|
|
95
|
+
{group.items?.map((item) => (
|
|
96
|
+
<li>
|
|
97
|
+
<a
|
|
98
|
+
href={`${base}${item.link}`}
|
|
99
|
+
class:list={{ active: path === item.link.replace(/^\//, "").replace(/\/$/, "") }}
|
|
100
|
+
>
|
|
101
|
+
{item.text}
|
|
102
|
+
</a>
|
|
103
|
+
</li>
|
|
104
|
+
))}
|
|
105
|
+
</ul>
|
|
106
|
+
</div>
|
|
107
|
+
))}
|
|
108
|
+
</aside>
|
|
109
|
+
)
|
|
110
|
+
}
|
|
111
|
+
<div class="site-content">
|
|
112
|
+
<slot />
|
|
113
|
+
</div>
|
|
114
|
+
</main>
|
|
115
|
+
{
|
|
116
|
+
!isHome && (
|
|
117
|
+
<footer class="site-footer">
|
|
118
|
+
<p>
|
|
119
|
+
Fontisan is a <a href="https://www.ribose.com/">Ribose</a> project ·
|
|
120
|
+
Copyright © 2026 Ribose Group Inc. All rights reserved.
|
|
121
|
+
</p>
|
|
122
|
+
</footer>
|
|
123
|
+
)
|
|
124
|
+
}
|
|
125
|
+
<script is:inline>
|
|
126
|
+
document.getElementById("theme-toggle")?.addEventListener("click", () => {
|
|
127
|
+
const dark = document.documentElement.classList.toggle("dark");
|
|
128
|
+
localStorage.setItem("fontisan-theme", dark ? "dark" : "light");
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
(() => {
|
|
132
|
+
const wrap = document.getElementById("header-search");
|
|
133
|
+
if (!wrap) return;
|
|
134
|
+
const input = document.getElementById("header-search-input");
|
|
135
|
+
const box = document.getElementById("header-search-results");
|
|
136
|
+
const entries = JSON.parse(input.dataset.entries);
|
|
137
|
+
const base = input.dataset.base;
|
|
138
|
+
|
|
139
|
+
function render(list) {
|
|
140
|
+
box.innerHTML = list
|
|
141
|
+
.map(
|
|
142
|
+
(e) =>
|
|
143
|
+
`<a href="${base}${e.url}"><span class="hs-section">${e.section}</span> ${e.title}</a>`,
|
|
144
|
+
)
|
|
145
|
+
.join("");
|
|
146
|
+
box.hidden = list.length === 0;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
input.addEventListener("input", () => {
|
|
150
|
+
const q = input.value.trim().toLowerCase();
|
|
151
|
+
if (!q) return (box.hidden = true);
|
|
152
|
+
render(entries.filter((e) => e.title.toLowerCase().includes(q)).slice(0, 8));
|
|
153
|
+
});
|
|
154
|
+
input.addEventListener("keydown", (e) => {
|
|
155
|
+
if (e.key === "Escape") {
|
|
156
|
+
box.hidden = true;
|
|
157
|
+
input.blur();
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
document.addEventListener("click", (e) => {
|
|
161
|
+
if (!wrap.contains(e.target)) box.hidden = true;
|
|
162
|
+
});
|
|
163
|
+
})();
|
|
164
|
+
</script>
|
|
165
|
+
<style>
|
|
166
|
+
.site-header {
|
|
167
|
+
position: sticky;
|
|
168
|
+
top: 0;
|
|
169
|
+
z-index: 50;
|
|
170
|
+
background: var(--vp-c-bg);
|
|
171
|
+
border-bottom: 1px solid var(--spec-rule);
|
|
172
|
+
}
|
|
173
|
+
.site-header-inner {
|
|
174
|
+
max-width: 1240px;
|
|
175
|
+
margin: 0 auto;
|
|
176
|
+
padding: 0 1.5rem;
|
|
177
|
+
height: 60px;
|
|
178
|
+
display: flex;
|
|
179
|
+
align-items: center;
|
|
180
|
+
gap: 1.5rem;
|
|
181
|
+
}
|
|
182
|
+
.site-logo img {
|
|
183
|
+
height: 34px;
|
|
184
|
+
display: block;
|
|
185
|
+
}
|
|
186
|
+
.site-nav {
|
|
187
|
+
display: flex;
|
|
188
|
+
align-items: center;
|
|
189
|
+
gap: 1.25rem;
|
|
190
|
+
flex: 1;
|
|
191
|
+
font-size: 0.9rem;
|
|
192
|
+
}
|
|
193
|
+
.site-nav a {
|
|
194
|
+
color: var(--vp-c-text-2);
|
|
195
|
+
text-decoration: none;
|
|
196
|
+
padding: 0.25rem 0;
|
|
197
|
+
}
|
|
198
|
+
.site-nav a:hover,
|
|
199
|
+
.site-nav a.active {
|
|
200
|
+
color: var(--vp-c-brand-1);
|
|
201
|
+
}
|
|
202
|
+
.theme-toggle {
|
|
203
|
+
border: 1px solid var(--spec-rule);
|
|
204
|
+
background: var(--vp-c-bg-soft);
|
|
205
|
+
border-radius: 8px;
|
|
206
|
+
padding: 0.25rem 0.5rem;
|
|
207
|
+
cursor: pointer;
|
|
208
|
+
color: var(--vp-c-text-2);
|
|
209
|
+
}
|
|
210
|
+
html:not(.dark) .theme-toggle-moon {
|
|
211
|
+
display: none;
|
|
212
|
+
}
|
|
213
|
+
html.dark .theme-toggle-sun {
|
|
214
|
+
display: none;
|
|
215
|
+
}
|
|
216
|
+
.site-main {
|
|
217
|
+
max-width: 1240px;
|
|
218
|
+
margin: 0 auto;
|
|
219
|
+
padding: 1.5rem;
|
|
220
|
+
display: flex;
|
|
221
|
+
gap: 2rem;
|
|
222
|
+
}
|
|
223
|
+
.site-main.with-sidebar .site-content {
|
|
224
|
+
flex: 1;
|
|
225
|
+
min-width: 0;
|
|
226
|
+
}
|
|
227
|
+
.site-sidebar {
|
|
228
|
+
width: 250px;
|
|
229
|
+
flex-shrink: 0;
|
|
230
|
+
font-size: 0.875rem;
|
|
231
|
+
}
|
|
232
|
+
.sidebar-group {
|
|
233
|
+
margin-bottom: 1.25rem;
|
|
234
|
+
}
|
|
235
|
+
.sidebar-heading {
|
|
236
|
+
font-size: 0.78rem;
|
|
237
|
+
font-weight: 700;
|
|
238
|
+
text-transform: uppercase;
|
|
239
|
+
letter-spacing: 0.04em;
|
|
240
|
+
color: var(--vp-c-text-1);
|
|
241
|
+
margin-bottom: 0.4rem;
|
|
242
|
+
}
|
|
243
|
+
.sidebar-group ul {
|
|
244
|
+
list-style: none;
|
|
245
|
+
margin: 0;
|
|
246
|
+
padding: 0;
|
|
247
|
+
}
|
|
248
|
+
.sidebar-group li a {
|
|
249
|
+
display: block;
|
|
250
|
+
padding: 0.22rem 0 0.22rem 0.75rem;
|
|
251
|
+
color: var(--vp-c-text-2);
|
|
252
|
+
text-decoration: none;
|
|
253
|
+
border-left: 2px solid transparent;
|
|
254
|
+
}
|
|
255
|
+
.sidebar-group li a:hover {
|
|
256
|
+
color: var(--vp-c-brand-1);
|
|
257
|
+
}
|
|
258
|
+
.sidebar-group li a.active {
|
|
259
|
+
color: var(--vp-c-brand-1);
|
|
260
|
+
border-left-color: var(--vp-c-brand-1);
|
|
261
|
+
}
|
|
262
|
+
.site-footer {
|
|
263
|
+
border-top: 1px solid var(--spec-rule);
|
|
264
|
+
background: var(--vp-c-bg-soft);
|
|
265
|
+
text-align: center;
|
|
266
|
+
padding: 1.25rem;
|
|
267
|
+
font-size: 0.85rem;
|
|
268
|
+
color: var(--vp-c-text-2);
|
|
269
|
+
}
|
|
270
|
+
.site-footer a {
|
|
271
|
+
color: var(--vp-c-brand-1);
|
|
272
|
+
}
|
|
273
|
+
.header-search {
|
|
274
|
+
position: relative;
|
|
275
|
+
}
|
|
276
|
+
.header-search input {
|
|
277
|
+
width: 220px;
|
|
278
|
+
padding: 0.4rem 0.75rem;
|
|
279
|
+
font-size: 0.85rem;
|
|
280
|
+
border: 1px solid var(--spec-rule);
|
|
281
|
+
border-radius: 8px;
|
|
282
|
+
background: var(--vp-c-bg-soft);
|
|
283
|
+
color: var(--vp-c-text-1);
|
|
284
|
+
}
|
|
285
|
+
.header-search-results {
|
|
286
|
+
position: absolute;
|
|
287
|
+
top: calc(100% + 0.4rem);
|
|
288
|
+
right: 0;
|
|
289
|
+
width: 320px;
|
|
290
|
+
background: var(--vp-c-bg);
|
|
291
|
+
border: 1px solid var(--spec-rule);
|
|
292
|
+
border-radius: 10px;
|
|
293
|
+
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
|
|
294
|
+
overflow: hidden;
|
|
295
|
+
z-index: 60;
|
|
296
|
+
}
|
|
297
|
+
.header-search-results a {
|
|
298
|
+
display: block;
|
|
299
|
+
padding: 0.55rem 0.9rem;
|
|
300
|
+
font-size: 0.85rem;
|
|
301
|
+
color: var(--vp-c-text-1);
|
|
302
|
+
text-decoration: none;
|
|
303
|
+
border-bottom: 1px solid var(--spec-rule);
|
|
304
|
+
}
|
|
305
|
+
.header-search-results a:last-child {
|
|
306
|
+
border-bottom: none;
|
|
307
|
+
}
|
|
308
|
+
.header-search-results a:hover {
|
|
309
|
+
background: var(--vp-c-bg-soft);
|
|
310
|
+
}
|
|
311
|
+
.hs-section {
|
|
312
|
+
font-size: 0.7rem;
|
|
313
|
+
text-transform: uppercase;
|
|
314
|
+
letter-spacing: 0.05em;
|
|
315
|
+
color: var(--vp-c-text-3);
|
|
316
|
+
margin-right: 0.4rem;
|
|
317
|
+
}
|
|
318
|
+
</style>
|
|
319
|
+
</body>
|
|
320
|
+
</html>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
import Site from "../layouts/Site.astro";
|
|
3
|
+
const base = import.meta.env.BASE_URL.replace(/\/$/, "");
|
|
4
|
+
---
|
|
5
|
+
<Site title="Page not found — Fontisan">
|
|
6
|
+
<div class="not-found">
|
|
7
|
+
<h1>404</h1>
|
|
8
|
+
<p>This page does not exist. Try the <a href={`${base}/guide/`}>guide</a>.</p>
|
|
9
|
+
</div>
|
|
10
|
+
<style>
|
|
11
|
+
.not-found { text-align: center; padding: 4rem 1rem; }
|
|
12
|
+
.not-found h1 { font-size: 4rem; color: var(--vp-c-brand-1); }
|
|
13
|
+
</style>
|
|
14
|
+
</Site>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
import Site from "../../layouts/Site.astro";
|
|
3
|
+
import { getCollection, render } from "astro:content";
|
|
4
|
+
|
|
5
|
+
export async function getStaticPaths() {
|
|
6
|
+
const entries = await getCollection("api");
|
|
7
|
+
return entries
|
|
8
|
+
.filter((e) => e.id !== "index")
|
|
9
|
+
.map((entry) => ({
|
|
10
|
+
params: { slug: entry.id.replace(/\/index$/, "") },
|
|
11
|
+
props: { entry },
|
|
12
|
+
}));
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const { entry } = Astro.props;
|
|
16
|
+
const { Content } = await render(entry);
|
|
17
|
+
---
|
|
18
|
+
<Site title={entry.data?.title ?? "api"} description={entry.data?.description}>
|
|
19
|
+
<article class="prose doc-page">
|
|
20
|
+
<Content />
|
|
21
|
+
</article>
|
|
22
|
+
</Site>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
import Site from "../../layouts/Site.astro";
|
|
3
|
+
import { getCollection, render } from "astro:content";
|
|
4
|
+
|
|
5
|
+
const entry = (await getCollection("api")).find((e) => e.id === "index");
|
|
6
|
+
const { Content } = await render(entry);
|
|
7
|
+
---
|
|
8
|
+
<Site title={entry.data?.title ?? "api"} description={entry.data?.description}>
|
|
9
|
+
<article class="prose doc-page">
|
|
10
|
+
<Content />
|
|
11
|
+
</article>
|
|
12
|
+
</Site>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
import Site from "../../layouts/Site.astro";
|
|
3
|
+
import { getCollection, render } from "astro:content";
|
|
4
|
+
|
|
5
|
+
export async function getStaticPaths() {
|
|
6
|
+
const entries = await getCollection("cli");
|
|
7
|
+
return entries
|
|
8
|
+
.filter((e) => e.id !== "index")
|
|
9
|
+
.map((entry) => ({
|
|
10
|
+
params: { slug: entry.id.replace(/\/index$/, "") },
|
|
11
|
+
props: { entry },
|
|
12
|
+
}));
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const { entry } = Astro.props;
|
|
16
|
+
const { Content } = await render(entry);
|
|
17
|
+
---
|
|
18
|
+
<Site title={entry.data?.title ?? "cli"} description={entry.data?.description}>
|
|
19
|
+
<article class="prose doc-page">
|
|
20
|
+
<Content />
|
|
21
|
+
</article>
|
|
22
|
+
</Site>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
import Site from "../../layouts/Site.astro";
|
|
3
|
+
import { getCollection, render } from "astro:content";
|
|
4
|
+
|
|
5
|
+
const entry = (await getCollection("cli")).find((e) => e.id === "index");
|
|
6
|
+
const { Content } = await render(entry);
|
|
7
|
+
---
|
|
8
|
+
<Site title={entry.data?.title ?? "cli"} description={entry.data?.description}>
|
|
9
|
+
<article class="prose doc-page">
|
|
10
|
+
<Content />
|
|
11
|
+
</article>
|
|
12
|
+
</Site>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
import Site from "../../layouts/Site.astro";
|
|
3
|
+
import { getCollection, render } from "astro:content";
|
|
4
|
+
|
|
5
|
+
export async function getStaticPaths() {
|
|
6
|
+
const entries = await getCollection("guide");
|
|
7
|
+
return entries
|
|
8
|
+
.filter((e) => e.id !== "index")
|
|
9
|
+
.map((entry) => ({
|
|
10
|
+
params: { slug: entry.id.replace(/\/index$/, "") },
|
|
11
|
+
props: { entry },
|
|
12
|
+
}));
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const { entry } = Astro.props;
|
|
16
|
+
const { Content } = await render(entry);
|
|
17
|
+
---
|
|
18
|
+
<Site title={entry.data?.title ?? "guide"} description={entry.data?.description}>
|
|
19
|
+
<article class="prose doc-page">
|
|
20
|
+
<Content />
|
|
21
|
+
</article>
|
|
22
|
+
</Site>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
import Site from "../../layouts/Site.astro";
|
|
3
|
+
import { getCollection, render } from "astro:content";
|
|
4
|
+
|
|
5
|
+
const entry = (await getCollection("guide")).find((e) => e.id === "index");
|
|
6
|
+
const { Content } = await render(entry);
|
|
7
|
+
---
|
|
8
|
+
<Site title={entry.data?.title ?? "guide"} description={entry.data?.description}>
|
|
9
|
+
<article class="prose doc-page">
|
|
10
|
+
<Content />
|
|
11
|
+
</article>
|
|
12
|
+
</Site>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
import Site from "../../layouts/Site.astro";
|
|
3
|
+
import { getCollection, render } from "astro:content";
|
|
4
|
+
|
|
5
|
+
export async function getStaticPaths() {
|
|
6
|
+
const entries = await getCollection("history");
|
|
7
|
+
return entries
|
|
8
|
+
.filter((e) => e.id !== "index")
|
|
9
|
+
.map((entry) => ({
|
|
10
|
+
params: { slug: entry.id.replace(/\/index$/, "") },
|
|
11
|
+
props: { entry },
|
|
12
|
+
}));
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const { entry } = Astro.props;
|
|
16
|
+
const { Content } = await render(entry);
|
|
17
|
+
---
|
|
18
|
+
<Site title={entry.data?.title ?? "history"} description={entry.data?.description}>
|
|
19
|
+
<article class="prose doc-page">
|
|
20
|
+
<Content />
|
|
21
|
+
</article>
|
|
22
|
+
</Site>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
import Site from "../../layouts/Site.astro";
|
|
3
|
+
import { getCollection, render } from "astro:content";
|
|
4
|
+
|
|
5
|
+
const base = import.meta.env.BASE_URL.replace(/\/$/, "");
|
|
6
|
+
const entries = await getCollection("history");
|
|
7
|
+
const indexEntry = entries.find((e) => e.id === "index");
|
|
8
|
+
const renderEntry = indexEntry
|
|
9
|
+
? (await render(indexEntry)).Content
|
|
10
|
+
: null;
|
|
11
|
+
const others = entries.filter((e) => e.id !== "index");
|
|
12
|
+
---
|
|
13
|
+
<Site title="History — Fontisan" description="Fontisan release history">
|
|
14
|
+
{renderEntry ? <article class="prose doc-page"><renderEntry /></article> : (
|
|
15
|
+
<article class="prose doc-page">
|
|
16
|
+
<h1>History</h1>
|
|
17
|
+
<ul>
|
|
18
|
+
{others.map((e) => (
|
|
19
|
+
<li><a href={`${base}/history/${e.id}`}>{e.data?.title ?? e.body?.match(/^# (.+)$/m)?.[1] ?? e.id}</a></li>
|
|
20
|
+
))}
|
|
21
|
+
</ul>
|
|
22
|
+
</article>
|
|
23
|
+
)}
|
|
24
|
+
</Site>
|