|
1 | 1 | import { getAllPosts } from "@/lib/blog"; |
2 | 2 | import { absoluteUrl, siteConfig } from "@/lib/site"; |
3 | 3 |
|
4 | | -export const dynamic = "force-static"; |
| 4 | +export const revalidate = 300; |
| 5 | + |
| 6 | +async function getStableVersion(): Promise<string | null> { |
| 7 | + try { |
| 8 | + const res = await fetch(siteConfig.stableManifestUrl, { |
| 9 | + next: { revalidate: 300 }, |
| 10 | + }); |
| 11 | + if (!res.ok) return null; |
| 12 | + const manifest = await res.json(); |
| 13 | + return manifest.version ?? null; |
| 14 | + } catch { |
| 15 | + return null; |
| 16 | + } |
| 17 | +} |
5 | 18 |
|
6 | 19 | export async function GET() { |
7 | | - const posts = await getAllPosts(); |
| 20 | + const [posts, version] = await Promise.all([ |
| 21 | + getAllPosts(), |
| 22 | + getStableVersion(), |
| 23 | + ]); |
| 24 | + |
| 25 | + const downloadsLine = version |
| 26 | + ? `- [Latest releases](${siteConfig.links.releases}) for macOS, Windows, and Linux. Current stable: v${version}.` |
| 27 | + : `- [Latest releases](${siteConfig.links.releases}) for macOS, Windows, and Linux.`; |
8 | 28 |
|
9 | 29 | const lines = [ |
10 | 30 | `# ${siteConfig.name}`, |
11 | 31 | "", |
12 | | - `> ${siteConfig.description}`, |
| 32 | + "> Native interactive notebooks. Fast to launch, agent ready, humans welcome.", |
| 33 | + "", |
| 34 | + "nteract is a desktop notebook app for macOS, Windows, and Linux. Open a `.ipynb` file, a kernel starts, you're running code. No browser, no server to manage.", |
| 35 | + "", |
| 36 | + "## Downloads", |
| 37 | + "", |
| 38 | + downloadsLine, |
| 39 | + `- [Source on GitHub](${siteConfig.links.github})`, |
13 | 40 | "", |
14 | 41 | "## Blog", |
15 | 42 | "", |
|
0 commit comments