This repository has no description
2.8 kB
89 lines
1---
2import Base from '../layouts/Base.astro';
3import Header from '../components/Header.astro';
4import SponsorGrid from '../components/SponsorGrid.astro';
5import NewsList from '../components/NewsList.astro';
6import { getEntry, getCollection, render } from 'astro:content';
7
8// Single source of truth: src/content/page.md.
9// Edit that file to change the home page content.
10const page = await getEntry('page', 'page');
11if (!page) throw new Error('Missing content entry: page/page.md');
12const { Content } = await render(page);
13
14const news = (await getCollection('news'))
15 .sort((a, b) => b.data.date.getTime() - a.data.date.getTime())
16 .slice(0, 5)
17 .map((entry) => ({
18 date: entry.data.date,
19 title: entry.data.title,
20 url: entry.data.url,
21 summary: entry.data.summary,
22 }));
23
24const { title, tagline, repo, sponsors, installCmd, installCall } = page.data;
25
26const shieldsUrl = `https://img.shields.io/github/stars/randoneering/pgFirstAid?style=flat`;
27const postgresRecommended = page.data.postgres_recommended;
28const managedSupport = page.data.managed_support.join(', ');
29---
30
31<Base
32 title={`${title} - PostgreSQL health-check SQL function`}
33 description={tagline}
34>
35 <Header title={title} />
36
37 <section id="hero">
38 <p>{tagline}</p>
39 <p>
40 <a href={repo} rel="noopener"
41 ><img src={shieldsUrl} alt="GitHub stars" /></a
42 >
43 </p>
44 {installCmd && (
45 <pre><code>{installCmd}</code></pre>
46 )}
47 {installCall && (
48 <p>Then: <code>{installCall}</code></p>
49 )}
50 </section>
51
52 <Content />
53
54 <section id="news">
55 <h2>News</h2>
56 {news.length > 0 ? (
57 <NewsList entries={news} />
58 ) : (
59 <p>No news yet. Check <a href={repo} rel="noopener">GitHub releases</a> for the latest.</p>
60 )}
61 </section>
62
63 <section id="sponsors">
64 <h2>Sponsors</h2>
65 <p>pgFirstAid is supported by:</p>
66 <SponsorGrid sponsors={sponsors} />
67 </section>
68
69 <footer>
70 <p>
71 <a href={repo} rel="noopener">pgFirstAid on GitHub</a> ·
72 <a href="/llms.txt">llms.txt</a> ·
73 <a href="/llms-full.txt">llms-full.txt</a> ·
74 <a href="/agents.txt">agents.txt</a>
75 </p>
76 </footer>
77</Base>
78
79<style is:global>
80 /* Make sure headings inside the page content have the right spacing */
81 section h2:first-child { margin-top: 0; }
82 section p { margin: 0.75rem 0; }
83 section ul { margin: 0.75rem 0 0.75rem 1.5rem; }
84 section pre { background: var(--code-bg); border: 1px solid var(--border); border-radius: 4px; padding: 1rem; overflow-x: auto; margin: 1rem 0; }
85 section code { font-family: var(--font-mono); font-size: 0.9em; }
86 section :not(pre) > code { background: var(--code-bg); padding: 0.1em 0.3em; border-radius: 3px; }
87 section h3 { font-size: 1.1rem; margin: 1.5rem 0 0.5rem; }
88 section h2 { color: var(--accent); }
89</style>