@yetistudio/astro-resilient
v1.0.1
Published
Generate resilient text and JSON builds from Astro static output.
Readme
@yeti/astro-resilient
Generate a resilient, text-first version of your Astro site automatically.
This integration builds a parallel lightweight representation of your website that can be consumed by:
- CLI tools
- Low-bandwidth clients
- Mesh / IPFS networks
- Future Yeti Grid infrastructure
✨ What it does
After a normal Astro build:
dist/ → normal HTML site
dist-light/ → text + JSON representation
ipfs-site/ → ready-to-upload IPFS artifact (optional)Each page gets:
/about → HTML
/about.txt → readable text
/about.json → structured content🚀 Installation
pnpm add -D @yeti/astro-resilient⚙️ Usage
import { defineConfig } from "astro/config";
import resilient from "@yeti/astro-resilient";
export default defineConfig({
integrations: [
resilient({
outDir: "dist-light",
selector: "main",
formats: ["txt", "json"],
ipfs: true,
}),
],
});📦 Output Structure
dist/
dist-light/
about.txt
about.json
ipfs-site/
manifest.json
html/
light/🌐 IPFS Deployment
Upload:
ipfs add -r ipfs-siteThen serve based on headers:
| Accept Header | Served File | |------|--------| | text/html | /html/... | | text/plain | /light/...txt | | application/yeti-light+json | /light/...json |
🧠 Data Attributes
You can enrich the light version using HTML attributes.
Context
Adds explanatory text.
<div data-resilient-context="This requires a wallet">
Send Token
</div>Replace
Replace complex UI with text.
<div data-resilient-replace="Not available in light mode">
<canvas>...</canvas>
</div>Action
Expose structured actions (Web3, CLI, etc.)
<div
data-resilient-action="ethereum:0x..."
data-resilient-context="Review before signing"
>
Send Token
</div>📄 Text Output Example
Send Token [action:1]
Actions:
[action:1] Send Token — Review before signing📄 JSON Output Example
{
"title": "Example",
"text": "Send Token",
"actions": [
{
"id": 1,
"label": "Send Token",
"uri": "ethereum:0x...",
"context": "Review before signing"
}
]
}🧭 Design Philosophy
HTML → UI
TXT → readable fallback
JSON → machine interfaceThis allows the same content to work across:
- Browsers
- CLI tools
- Low-bandwidth environments
- Decentralized networks
🔥 Future Ideas
- CLI browser (
yeti read <url>) - Action execution (wallet deep links)
- Mesh / radio transmission
- Offline-first content distribution
🧩 Why this matters
Modern web apps are heavy and fragile.
This provides:
- Resilience
- Accessibility
- Portability
- Decentralization readiness
🧑💻 License
MIT
