Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Register the repository in `content-sources.yaml`:
sources:
- owner: thiagogcm
repo: adf4j
slug: adf4j-docs
slug: adf4j
order: 0
```

Expand All @@ -74,11 +74,11 @@ During sync, the site validates frontmatter and page order, removes source-owned

Cloudflare Workers is both the request entrypoint and the runtime for the few features that need server-side behavior:

| Runtime path | Cloudflare responsibility | Result |
| --- | --- | --- |
| Normal page request | Serve the built site and run server-rendered fragments | Most content remains pre-rendered; dynamic work stays isolated. |
| Scheduled event | Query GitHub every six hours and write the aggregate to KV | Page requests read cached activity data instead of calling GitHub. |
| Cold stats cache | Start a background refresh with the request context | The response can show a fallback without waiting on GitHub. |
| Runtime path | Cloudflare responsibility | Result |
| -------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
| Normal page request | Serve the built site and run server-rendered fragments | Most content remains pre-rendered; dynamic work stays isolated. |
| Scheduled event | Query GitHub every six hours and write the aggregate to KV | Page requests read cached activity data instead of calling GitHub. |
| Cold stats cache | Start a background refresh with the request context | The response can show a fallback without waiting on GitHub. |
| `/api/confluence-adf.json` | Validate a public Confluence Cloud URL and fetch its ADF body | The browser receives a narrow JSON response, then performs the Markdown conversion locally. |

The Worker delegates regular requests to the site runtime. Its scheduled handler refreshes GitHub statistics. The status island reads those statistics from the `GITHUB_STATS` KV namespace, while the Confluence route accepts only HTTPS `*.atlassian.net` wiki page URLs containing a numeric page ID.
Expand All @@ -87,14 +87,14 @@ This boundary is intentional: content assembly belongs to the build, presentatio

## Working locally

| Command | Purpose |
| --- | --- |
| `npm run dev` | Sync external content, then start the development server. |
| `npm run sync:content` | Rebuild generated content from registered sources. |
| `npm run validate:sources` | Validate sources without writing generated output. |
| `npm run test:content-sync` | Test content normalization and link rewriting. |
| `npm run check` | Type-check the site and Worker integration. |
| `npm run build` | Sync content and produce the deployment build. |
| Command | Purpose |
| --------------------------- | --------------------------------------------------------- |
| `npm run dev` | Sync external content, then start the development server. |
| `npm run sync:content` | Rebuild generated content from registered sources. |
| `npm run validate:sources` | Validate sources without writing generated output. |
| `npm run test:content-sync` | Test content normalization and link rewriting. |
| `npm run check` | Type-check the site and Worker integration. |
| `npm run build` | Sync content and produce the deployment build. |

## Deployment

Expand Down
38 changes: 19 additions & 19 deletions astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,52 +1,52 @@
import { defineConfig, fontProviders } from 'astro/config';
import cloudflare from '@astrojs/cloudflare';
import { unified } from '@astrojs/markdown-remark';
import adf4jWasm from '@nthings.dev/adf4j-wasm/vite';
import tailwindcss from '@tailwindcss/vite';
import cloudflare from "@astrojs/cloudflare";
import { unified } from "@astrojs/markdown-remark";
import adf4jWasm from "@nthings.dev/adf4j-wasm/vite";
import tailwindcss from "@tailwindcss/vite";
import { defineConfig, fontProviders } from "astro/config";

export default defineConfig({
site: 'https://nthings.dev',
site: "https://nthings.dev",
adapter: cloudflare({
platformProxy: { enabled: true },
}),
vite: {
plugins: [tailwindcss(), adf4jWasm()],
},
markdown: {
syntaxHighlight: 'shiki',
syntaxHighlight: "shiki",
// Dual themes: light colors inline, dark swapped via --shiki-dark in global.css.
shikiConfig: {
themes: {
light: 'github-light',
dark: 'github-dark',
light: "github-light",
dark: "github-dark",
},
},
processor: unified({
smartypants: {
dashes: 'oldschool',
dashes: "oldschool",
},
}),
},
prefetch: {
prefetchAll: true,
defaultStrategy: 'hover',
defaultStrategy: "hover",
},
fonts: [
{
provider: fontProviders.google(),
name: 'Inter',
cssVariable: '--font-body',
name: "Inter",
cssVariable: "--font-body",
weights: [400, 500, 600, 700],
subsets: ['latin'],
fallbacks: ['system-ui', '-apple-system', 'sans-serif'],
subsets: ["latin"],
fallbacks: ["system-ui", "-apple-system", "sans-serif"],
},
{
provider: fontProviders.google(),
name: 'JetBrains Mono',
cssVariable: '--font-code',
name: "JetBrains Mono",
cssVariable: "--font-code",
weights: [400, 500],
subsets: ['latin'],
fallbacks: ['ui-monospace', 'monospace'],
subsets: ["latin"],
fallbacks: ["ui-monospace", "monospace"],
},
],
});
64 changes: 64 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"$schema": "https://biomejs.dev/schemas/2.5.0/schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true
},
"files": {
"ignoreUnknown": true,
"includes": [
"src/**",
"!src/**/*.css",
"astro.config.mjs",
"tsconfig.json",
"package.json"
]
},
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 2,
"lineWidth": 80,
"lineEnding": "lf"
},
"linter": {
"enabled": true,
"rules": {
"preset": "recommended",
"style": {
"noNonNullAssertion": "off"
}
}
},
"javascript": {
"formatter": {
"quoteStyle": "double",
"semicolons": "always"
}
},
"assist": {
"enabled": true,
"actions": {
"source": {
"organizeImports": "on"
}
}
},
"overrides": [
{
"includes": [
"**/*.astro"
],
"linter": {
"rules": {
"correctness": {
"noUnusedVariables": "off",
"noUnusedImports": "off",
"noUnusedFunctionParameters": "off"
}
}
}
}
]
}
1 change: 0 additions & 1 deletion content-sources.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,3 @@ sources:
- owner: thiagogcm
repo: helm4j
order: 2

Loading