Mirror of github.com/ewanc26/svelte-standard-site
  • Svelte 49%
  • TypeScript 42.3%
  • CSS 4.6%
  • JavaScript 3.9%
  • HTML 0.2%
Find a file
2026-07-16 18:22:46 +01:00
.vscode init: library template setup 2026-01-18 16:47:16 +00:00
docs feat: add ATProto publishing, comments, and content tooling 2026-01-25 15:52:13 +00:00
scripts feat: add ATProto publishing, comments, and content tooling 2026-01-25 15:52:13 +00:00
src feat: add ATProto publishing, comments, and content tooling 2026-01-25 15:52:13 +00:00
static init: library template setup 2026-01-18 16:47:16 +00:00
.env.example feat: initial release with client, components, docs, and examples 2026-01-18 18:23:14 +00:00
.gitignore init: library template setup 2026-01-18 16:47:16 +00:00
.npmrc init: library template setup 2026-01-18 16:47:16 +00:00
.prettierignore init: library template setup 2026-01-18 16:47:16 +00:00
.prettierrc init: library template setup 2026-01-18 16:47:16 +00:00
AGENTS.md docs: correct agent guidance after source audit 2026-07-16 18:22:46 +01:00
API.md feat: enhance documentation and design system components 2026-01-19 11:45:10 +00:00
CLAUDE.md feat: add ATProto publishing, comments, and content tooling 2026-01-25 15:52:13 +00:00
CONTRIBUTING.md Update CONTRIBUTING.md 2026-01-18 18:26:41 +00:00
EXAMPLES.md feat: add DocumentRenderer with math and code highlighting support 2026-01-25 03:24:03 +00:00
LICENSE Initial commit 2026-01-18 16:40:11 +00:00
package.json chore: rename to @ewanc26/svelte-standard-site; point to pkgs as canonical source 2026-03-07 12:06:05 +00:00
pnpm-lock.yaml feat: add DocumentRenderer with math and code highlighting support 2026-01-25 03:24:03 +00:00
pnpm-workspace.yaml init: library template setup 2026-01-18 16:47:16 +00:00
README.md chore: rename to @ewanc26/svelte-standard-site; point to pkgs as canonical source 2026-03-07 12:06:05 +00:00
svelte.config.js init: library template setup 2026-01-18 16:47:16 +00:00
tsconfig.json init: library template setup 2026-01-18 16:47:16 +00:00
vite.config.ts init: library template setup 2026-01-18 16:47:16 +00:00
vitest.config.ts feat: add ATProto publishing, comments, and content tooling 2026-01-25 15:52:13 +00:00

@ewanc26/svelte-standard-site

Canonical source: This package is now maintained in the @ewanc26/pkgs monorepo under packages/svelte-standard-site. This copy exists for historical context — please open issues and PRs there.

A SvelteKit library for reading and writing AT Protocol longform content via site.standard.* records. Includes a complete design system, publishing tools, federated Bluesky comments, content verification helpers, and pre-built components.

Part of the @ewanc26/pkgs monorepo.

Installation

pnpm add @ewanc26/svelte-standard-site zod

Requires svelte >= 5 and @sveltejs/kit >= 2 as peer dependencies.

Features

  • Reading — Fetch site.standard.document and site.standard.publication records from AT Protocol
  • Writing — Publish and manage documents via StandardSitePublisher
  • Comments — Federated Bluesky replies as comments via the <Comments /> component
  • Verification.well-known endpoint helpers to prove content ownership
  • Design system — Semantic colour tokens (ink, canvas, primary, secondary, accent) with automatic light/dark mode via Tailwind CSS 4
  • Type-safe — Full TypeScript with Zod validation
  • SSR-ready — Works with SvelteKit's fetch for prerendering
  • Caching — In-memory cache with configurable TTL

Quick Start

Reading

// src/routes/+page.server.ts
import { createClient } from '@ewanc26/svelte-standard-site';

export const load = async ({ fetch }) => {
  const client = createClient({ did: 'did:plc:your-did' });
  const documents = await client.fetchAllDocuments(fetch);
  return { documents };
};

Publishing

import { StandardSitePublisher } from '@ewanc26/svelte-standard-site/publisher';

const publisher = new StandardSitePublisher({
  identifier: 'you.bsky.social',
  password: process.env.ATPROTO_APP_PASSWORD
});
await publisher.login();
await publisher.publishDocument({ site, title, content, publishedAt });

Comments

<script>
  import { Comments } from '@ewanc26/svelte-standard-site';
</script>

<Comments
  bskyPostUri="at://did:plc:xxx/app.bsky.feed.post/abc"
  canonicalUrl="https://yourblog.com/posts/my-post"
/>

Entry Points

Import Description
@ewanc26/svelte-standard-site Components, client, stores, types, utilities
@ewanc26/svelte-standard-site/publisher StandardSitePublisher for writing records
@ewanc26/svelte-standard-site/content Markdown transformation utilities
@ewanc26/svelte-standard-site/comments Comment fetching utilities
@ewanc26/svelte-standard-site/verification .well-known and ownership verification
@ewanc26/svelte-standard-site/schemas Zod schemas and COLLECTIONS constant
@ewanc26/svelte-standard-site/config/env getConfigFromEnv() SvelteKit helper
@ewanc26/svelte-standard-site/styles/base.css Base CSS
@ewanc26/svelte-standard-site/styles/themes.css Theme CSS

Development

Development happens in the @ewanc26/pkgs monorepo. Local commands (from packages/svelte-standard-site):

pnpm build       # svelte-package → dist/
pnpm dev         # svelte-package --watch
pnpm dev:app     # vite dev (demo routes)
pnpm check       # svelte-check
pnpm test        # vitest run

Environment Variables

PUBLIC_ATPROTO_DID=did:plc:your-did-here
PUBLIC_PUBLICATION_RKEY=3abc123xyz

# For publishing (never commit)
ATPROTO_APP_PASSWORD=xxxx-xxxx-xxxx-xxxx
ATPROTO_HANDLE=you.bsky.social

Licence

AGPL-3.0-only — see the pkgs monorepo licence.