renderMarkdown only exists inside a content loader, and the README should render through the site's own pipeline. One loader also means the home and every plugin page share a single registry read per build. Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
91 lines
3.4 KiB
Plaintext
91 lines
3.4 KiB
Plaintext
---
|
||
import { getCollection } from 'astro:content';
|
||
import Header from '../components/Header.astro';
|
||
import Footer from '../components/Footer.astro';
|
||
import PluginCard from '../components/PluginCard.astro';
|
||
import '../styles/global.css';
|
||
|
||
// Read at build time by the collection's loader (scripts/loader.mjs) — this site is static files
|
||
// on cPanel. Under CI a registry that does not answer fails the build; off CI that entry is left out.
|
||
const plugins = (await getCollection('plugins'))
|
||
.map(({ id, data }) => ({
|
||
slug: id,
|
||
name: data.pkg,
|
||
description: data.description,
|
||
repo: data.repo,
|
||
npm: data.npm,
|
||
jsr: data.jsr,
|
||
version: data.version,
|
||
runtimes: data.runtimes,
|
||
// An internal plugin could be listed on npm alone and still be ours, so check both fields.
|
||
internal: (data.jsr ?? data.npm ?? '').startsWith('@green-tea/'),
|
||
}))
|
||
.sort((a, b) => a.name.localeCompare(b.name));
|
||
---
|
||
|
||
<html lang="en">
|
||
<head>
|
||
<meta charset="utf-8" />
|
||
<meta name="viewport" content="width=device-width" />
|
||
<link rel="icon" href="/plugins/favicon.svg" type="image/svg+xml" />
|
||
<title>Green Tea. plugins</title>
|
||
<meta name="description" content="Plugins for green-tea, with the runtimes each one declares." />
|
||
<link rel="canonical" href="https://green-tea.expressive-tea.io/plugins" />
|
||
</head>
|
||
<body>
|
||
<Header />
|
||
|
||
<main>
|
||
<section class="hero wrap">
|
||
<h1>Plugins</h1>
|
||
<p class="hero__lead">
|
||
A plugin is a named object that adds steps and providers to your graph. It imports
|
||
green-tea as types only, so installing one never pulls a second copy of core.
|
||
</p>
|
||
<p class="requires">
|
||
Everything here needs <code>@green-tea/core@26.9.0-beta.2</code> or newer. That is the
|
||
release where a plugin became <code>{ name, mount }</code> and
|
||
<code>app.boot()</code> went public; on anything older these will not mount.
|
||
</p>
|
||
</section>
|
||
|
||
<section class="wrap">
|
||
<div class="grid">
|
||
{plugins.map((plugin) => <PluginCard {...plugin} />)}
|
||
</div>
|
||
</section>
|
||
|
||
<section class="contribute wrap" id="contribute">
|
||
<h2>Add your plugin</h2>
|
||
<p>
|
||
Fork the listing, add one file under <code>src/content/plugins/</code>, open a pull
|
||
request. There is no version and no runtimes field — both are read from the registry, so
|
||
your entry cannot go stale.
|
||
</p>
|
||
|
||
<pre><code>npm: green-tea-foo # at least one of npm / jsr
|
||
jsr: "@acme/green-tea-foo"
|
||
repo: https://github.com/acme/green-tea-foo
|
||
description: "One sentence, 20–200 characters."</code></pre>
|
||
|
||
<p>
|
||
A check runs against npm and JSR: the package has to exist, depend on
|
||
<code>@green-tea/core</code>, and declare at least one runtime. Then a person reads it —
|
||
that it really is a factory returning <code>{ name, mount }</code>, and that its
|
||
README lists all four runtimes with a reason beside each one it does not support.
|
||
</p>
|
||
<p class="contribute__cadence">
|
||
Merged entries go live on the next <strong>Friday</strong> cut.
|
||
</p>
|
||
<p>
|
||
<a class="button" href="https://github.com/Expressive-Tea/green-tea-marketplace">
|
||
Open the listing on GitHub →
|
||
</a>
|
||
</p>
|
||
</section>
|
||
</main>
|
||
|
||
<Footer />
|
||
</body>
|
||
</html>
|