getfilepress 0.1.8 → 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -0
- package/package.json +107 -102
- package/packages/app/src/routes/posts/+page.server.ts +12 -0
- package/packages/app/src/routes/posts/+page.svelte +38 -0
- package/packages/app/src/routes/writing/+page.server.ts +2 -6
- package/packages/app/src/routes/writing/+page.svelte +1 -38
- package/packages/core/src/lib/components/PostIndex.svelte +1 -1
- package/packages/core/src/lib/config.ts +4 -4
- package/packages/core/src/lib/content/feeds.ts +1 -1
- package/scripts/filepress.mjs +0 -0
- package/packages/app/README.md +0 -19
- package/packages/core/README.md +0 -29
package/README.md
CHANGED
|
@@ -200,6 +200,8 @@ Any other static host works the same way: publish `build/` as the web root. The
|
|
|
200
200
|
|
|
201
201
|
Full notes (including an agent checklist): [`docs/DEPLOY.md`](docs/DEPLOY.md) · product page: [getfilepress.com/deploy](https://getfilepress.com/deploy).
|
|
202
202
|
|
|
203
|
+
If the site ships an agent skill, write the install page from [`docs/SKILL_PAGE.md`](docs/SKILL_PAGE.md) · [getfilepress.com/skill-page](https://getfilepress.com/skill-page).
|
|
204
|
+
|
|
203
205
|
## Repository layout
|
|
204
206
|
|
|
205
207
|
```
|
|
@@ -215,6 +217,12 @@ scripts/ filepress CLI and create-site scaffold
|
|
|
215
217
|
pnpm test # engine unit tests
|
|
216
218
|
```
|
|
217
219
|
|
|
220
|
+
<!-- xfacts-nutrition-label -->
|
|
221
|
+
|
|
222
|
+
## Nutrition label
|
|
223
|
+
|
|
224
|
+
- **AppFacts:** [viewer](https://appfacts.dev/v#af1.eNptkkGLGzEMhf-K0dnZoVefygZKt01KYbK9lKUotjLxxmMZWzNhCPnvxZNk9tAebX9Pen7SBUYwnzRE7AkMHHyglKkU0CBTqlc9R86UGDQUQRkKGEArfiTQELylWCq2fdndCHsCc4GAsRuwqy-7KVFrs0-iVTtSENLqG474uFu3rVZfd9sNaMhDFD87-cGOnt6rj0PGns6cT2Dgpv_uBTTsh-gCZTDwywvNzafgYwcG1m0LGo5c5H4OPLhDwEzqJ3ZU4KrBUSpgfl8ggoHPZS78XprTXDtVEWdSZ9qrDwNXfcNv9J17fVGW-8SRovyHHf1CPg8-OCXMQWF0ytGoCuWR8gLLkKPjc1wsxJGyzOkoYbXFfJqfH_wQ_cGTezi5nZTlKNVMymypFB87lXyi4CMtysAWw56yHO_iLUbsSCXOogJhoaIOnNXMVasUOPUUBa5vGspol-z-CVdDHUorKN6q-xCql9G7-tW3OjofXF2ThPaEHf3p5-ZVlmLq6_JRkSXolT2SrYlCXcTihfMEBo4iqZim6bwch_2T5b5Zo2CYiqy-cO5otdmsm4-Vvv4FzW_8rQ) · [raw](https://github.com/Catalyst-Forge-LLC/filepress/blob/main/APP_FACTS.md)
|
|
225
|
+
|
|
218
226
|
## License
|
|
219
227
|
|
|
220
228
|
MIT — see [LICENSE](LICENSE).
|
package/package.json
CHANGED
|
@@ -1,102 +1,107 @@
|
|
|
1
|
-
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "getfilepress",
|
|
3
|
+
"version": "0.1.9",
|
|
4
|
+
"private": false,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"description": "FilePress — file-based Markdown blog engine. Link this package from a content-only site (config + posts), then run `filepress build`.",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"homepage": "https://getfilepress.com",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/Catalyst-Forge-LLC/filepress.git"
|
|
12
|
+
},
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/Catalyst-Forge-LLC/filepress/issues"
|
|
15
|
+
},
|
|
16
|
+
"bin": {
|
|
17
|
+
"filepress": "./scripts/filepress.mjs",
|
|
18
|
+
"getfilepress": "./scripts/filepress.mjs"
|
|
19
|
+
},
|
|
20
|
+
"exports": {
|
|
21
|
+
".": {
|
|
22
|
+
"types": "./packages/core/src/lib/index.ts",
|
|
23
|
+
"svelte": "./packages/core/src/lib/index.ts",
|
|
24
|
+
"default": "./packages/core/src/lib/index.ts"
|
|
25
|
+
},
|
|
26
|
+
"./server": {
|
|
27
|
+
"types": "./packages/core/src/lib/server.ts",
|
|
28
|
+
"default": "./packages/core/src/lib/server.ts"
|
|
29
|
+
},
|
|
30
|
+
"./theme": {
|
|
31
|
+
"default": "./packages/core/src/lib/theme.ts"
|
|
32
|
+
},
|
|
33
|
+
"./package.json": "./package.json"
|
|
34
|
+
},
|
|
35
|
+
"files": [
|
|
36
|
+
"scripts/filepress.mjs",
|
|
37
|
+
"scripts/copy-path-mounts.mjs",
|
|
38
|
+
"scripts/create-site.mjs",
|
|
39
|
+
"scripts/ensure-lease.mjs",
|
|
40
|
+
"scripts/postinstall.mjs",
|
|
41
|
+
"scripts/link-embedded-packages.mjs",
|
|
42
|
+
"packages/core",
|
|
43
|
+
"packages/app",
|
|
44
|
+
"packages/import",
|
|
45
|
+
"pnpm-workspace.yaml",
|
|
46
|
+
"README.md",
|
|
47
|
+
"LICENSE"
|
|
48
|
+
],
|
|
49
|
+
"scripts": {
|
|
50
|
+
"postinstall": "node scripts/postinstall.mjs",
|
|
51
|
+
"filepress": "node scripts/filepress.mjs",
|
|
52
|
+
"test": "pnpm --filter @filepress/core test && pnpm --filter @filepress/import test && pnpm --filter @filepress/app test && tsx --test scripts/sync-sibling-sites.test.ts",
|
|
53
|
+
"check": "pnpm filepress check --site demo",
|
|
54
|
+
"build": "pnpm filepress build --site demo",
|
|
55
|
+
"build:demo": "pnpm filepress build --site demo",
|
|
56
|
+
"build:www": "pnpm filepress build --site getfilepress",
|
|
57
|
+
"ship": "pnpm build:www && wrangler pages deploy sites/getfilepress/build --project-name getfilepress",
|
|
58
|
+
"deploy:www": "pnpm ship",
|
|
59
|
+
"dev": "node scripts/ensure-lease.mjs demo 5179 && pnpm filepress dev --site demo --host 0.0.0.0",
|
|
60
|
+
"dev:demo": "node scripts/ensure-lease.mjs demo 5179 && pnpm filepress dev --site demo --host 0.0.0.0",
|
|
61
|
+
"dev:www": "node scripts/ensure-lease.mjs getfilepress 5180 && pnpm filepress dev --site getfilepress --host 0.0.0.0",
|
|
62
|
+
"create-site": "node scripts/create-site.mjs",
|
|
63
|
+
"sync-siblings": "tsx scripts/sync-sibling-sites.ts",
|
|
64
|
+
"siblings": "tsx scripts/siblings/server.ts",
|
|
65
|
+
"import": "node scripts/filepress.mjs import",
|
|
66
|
+
"prepublishOnly": "node scripts/publish-gate.mjs",
|
|
67
|
+
"prepack": "node scripts/prepack.mjs",
|
|
68
|
+
"postpack": "node scripts/postpack.mjs",
|
|
69
|
+
"pack:smoke": "node scripts/pack-smoke.mjs"
|
|
70
|
+
},
|
|
71
|
+
"dependencies": {
|
|
72
|
+
"@fontsource-variable/inter": "^5.2.8",
|
|
73
|
+
"@fontsource-variable/newsreader": "^5.2.10",
|
|
74
|
+
"@sveltejs/adapter-static": "^3.0.10",
|
|
75
|
+
"@sveltejs/kit": "^2.63.0",
|
|
76
|
+
"@sveltejs/vite-plugin-svelte": "^7.1.2",
|
|
77
|
+
"@types/turndown": "^5.0.5",
|
|
78
|
+
"fast-xml-parser": "^5.2.5",
|
|
79
|
+
"gray-matter": "^4.0.3",
|
|
80
|
+
"highlight.js": "^11.11.1",
|
|
81
|
+
"linkedom": "^0.18.12",
|
|
82
|
+
"ollanet": "^0.4.0",
|
|
83
|
+
"rehype-autolink-headings": "^7.1.0",
|
|
84
|
+
"rehype-highlight": "^7.0.2",
|
|
85
|
+
"rehype-raw": "^7.0.0",
|
|
86
|
+
"rehype-slug": "^6.0.0",
|
|
87
|
+
"rehype-stringify": "^10.0.1",
|
|
88
|
+
"remark-gfm": "^4.0.1",
|
|
89
|
+
"remark-parse": "^11.0.0",
|
|
90
|
+
"remark-rehype": "^11.1.2",
|
|
91
|
+
"sirv-cli": "^3.0.1",
|
|
92
|
+
"svelte": "^5.56.1",
|
|
93
|
+
"svelte-check": "^4.6.0",
|
|
94
|
+
"tsx": "^4.20.5",
|
|
95
|
+
"turndown": "^7.2.1",
|
|
96
|
+
"typescript": "^6.0.3",
|
|
97
|
+
"unified": "^11.0.5",
|
|
98
|
+
"vite": "^8.0.16"
|
|
99
|
+
},
|
|
100
|
+
"engines": {
|
|
101
|
+
"node": ">=20"
|
|
102
|
+
},
|
|
103
|
+
"packageManager": "pnpm@10.30.1",
|
|
104
|
+
"devDependencies": {
|
|
105
|
+
"wrangler": "^4.120.1"
|
|
106
|
+
}
|
|
107
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { redirect } from '@sveltejs/kit';
|
|
2
|
+
import type { PageServerLoad } from './$types';
|
|
3
|
+
import { content } from '$lib/content.server';
|
|
4
|
+
import config from '$site-config';
|
|
5
|
+
|
|
6
|
+
export const load: PageServerLoad = () => {
|
|
7
|
+
// Without homePage, the post index stays at `/`.
|
|
8
|
+
if (!config.homePage) {
|
|
9
|
+
redirect(302, '/');
|
|
10
|
+
}
|
|
11
|
+
return content.getIndexPage(1, config.postsPerPage);
|
|
12
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { PageData } from './$types';
|
|
3
|
+
import { PostIndex, absoluteUrl, ogImageUrl, postsIndexPath } from '@filepress/core';
|
|
4
|
+
import config from '$site-config';
|
|
5
|
+
|
|
6
|
+
let { data }: { data: PageData } = $props();
|
|
7
|
+
|
|
8
|
+
const pageTitle = $derived(`Posts — ${config.title}`);
|
|
9
|
+
const canonical = $derived(absoluteUrl(config, postsIndexPath(config)));
|
|
10
|
+
const ogImage = $derived(ogImageUrl(config));
|
|
11
|
+
const description = $derived(
|
|
12
|
+
`Posts from ${config.title}. ${config.description}`.trim()
|
|
13
|
+
);
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<svelte:head>
|
|
17
|
+
<title>{pageTitle}</title>
|
|
18
|
+
<meta name="description" content={description} />
|
|
19
|
+
<link rel="canonical" href={canonical} />
|
|
20
|
+
<meta property="og:type" content="website" />
|
|
21
|
+
<meta property="og:title" content="Posts — {config.title}" />
|
|
22
|
+
<meta property="og:description" content={description} />
|
|
23
|
+
<meta property="og:url" content={canonical} />
|
|
24
|
+
{#if ogImage}
|
|
25
|
+
<meta property="og:image" content={ogImage} />
|
|
26
|
+
<meta name="twitter:card" content="summary" />
|
|
27
|
+
<meta name="twitter:image" content={ogImage} />
|
|
28
|
+
{/if}
|
|
29
|
+
</svelte:head>
|
|
30
|
+
|
|
31
|
+
<PostIndex
|
|
32
|
+
site={config}
|
|
33
|
+
featured={data.featured}
|
|
34
|
+
posts={data.posts}
|
|
35
|
+
page={data.page}
|
|
36
|
+
totalPages={data.totalPages}
|
|
37
|
+
indexHref={postsIndexPath(config)}
|
|
38
|
+
/>
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import { redirect } from '@sveltejs/kit';
|
|
2
2
|
import type { PageServerLoad } from './$types';
|
|
3
|
-
import {
|
|
3
|
+
import { postsIndexPath } from '@filepress/core';
|
|
4
4
|
import config from '$site-config';
|
|
5
5
|
|
|
6
6
|
export const load: PageServerLoad = () => {
|
|
7
|
-
|
|
8
|
-
if (!config.homePage) {
|
|
9
|
-
redirect(302, '/');
|
|
10
|
-
}
|
|
11
|
-
return content.getIndexPage(1, config.postsPerPage);
|
|
7
|
+
redirect(308, postsIndexPath(config));
|
|
12
8
|
};
|
|
@@ -1,38 +1 @@
|
|
|
1
|
-
<
|
|
2
|
-
import type { PageData } from './$types';
|
|
3
|
-
import { PostIndex, absoluteUrl, ogImageUrl, postsIndexPath } from '@filepress/core';
|
|
4
|
-
import config from '$site-config';
|
|
5
|
-
|
|
6
|
-
let { data }: { data: PageData } = $props();
|
|
7
|
-
|
|
8
|
-
const pageTitle = $derived(`Posts — ${config.title}`);
|
|
9
|
-
const canonical = $derived(absoluteUrl(config, postsIndexPath(config)));
|
|
10
|
-
const ogImage = $derived(ogImageUrl(config));
|
|
11
|
-
const description = $derived(
|
|
12
|
-
`Posts from ${config.title}. ${config.description}`.trim()
|
|
13
|
-
);
|
|
14
|
-
</script>
|
|
15
|
-
|
|
16
|
-
<svelte:head>
|
|
17
|
-
<title>{pageTitle}</title>
|
|
18
|
-
<meta name="description" content={description} />
|
|
19
|
-
<link rel="canonical" href={canonical} />
|
|
20
|
-
<meta property="og:type" content="website" />
|
|
21
|
-
<meta property="og:title" content="Posts — {config.title}" />
|
|
22
|
-
<meta property="og:description" content={description} />
|
|
23
|
-
<meta property="og:url" content={canonical} />
|
|
24
|
-
{#if ogImage}
|
|
25
|
-
<meta property="og:image" content={ogImage} />
|
|
26
|
-
<meta name="twitter:card" content="summary" />
|
|
27
|
-
<meta name="twitter:image" content={ogImage} />
|
|
28
|
-
{/if}
|
|
29
|
-
</svelte:head>
|
|
30
|
-
|
|
31
|
-
<PostIndex
|
|
32
|
-
site={config}
|
|
33
|
-
featured={data.featured}
|
|
34
|
-
posts={data.posts}
|
|
35
|
-
page={data.page}
|
|
36
|
-
totalPages={data.totalPages}
|
|
37
|
-
indexHref={postsIndexPath(config)}
|
|
38
|
-
/>
|
|
1
|
+
<p>Moved to <a href="/posts">/posts</a>.</p>
|
|
@@ -55,7 +55,7 @@ export interface SiteConfig {
|
|
|
55
55
|
postsPerPage: number;
|
|
56
56
|
/**
|
|
57
57
|
* When set, `/` renders this static page slug (`pages/<slug>.md`) and the
|
|
58
|
-
* chronological post index moves to `/
|
|
58
|
+
* chronological post index moves to `/posts`.
|
|
59
59
|
*/
|
|
60
60
|
homePage: string | null;
|
|
61
61
|
nav: NavItem[];
|
|
@@ -86,7 +86,7 @@ export interface SiteConfigInput {
|
|
|
86
86
|
ogImage?: string;
|
|
87
87
|
author?: string;
|
|
88
88
|
postsPerPage?: number;
|
|
89
|
-
/** Static page slug to show at `/` (post index then lives at `/
|
|
89
|
+
/** Static page slug to show at `/` (post index then lives at `/posts`). */
|
|
90
90
|
homePage?: string;
|
|
91
91
|
nav?: NavItem[];
|
|
92
92
|
/** Custom footer links; replaces the default RSS + Topics row when set. */
|
|
@@ -120,7 +120,7 @@ function normalizeNavItems(items: NavItem[] | undefined): NavItem[] | null {
|
|
|
120
120
|
|
|
121
121
|
/** Path to page 1 of the chronological post index. */
|
|
122
122
|
export function postsIndexPath(site: Pick<SiteConfig, 'homePage'>): string {
|
|
123
|
-
return site.homePage ? '/
|
|
123
|
+
return site.homePage ? '/posts' : '/';
|
|
124
124
|
}
|
|
125
125
|
|
|
126
126
|
/**
|
|
@@ -151,7 +151,7 @@ export function defineFilepressConfig(input: SiteConfigInput): SiteConfig {
|
|
|
151
151
|
const defaultNav: NavItem[] = homePage
|
|
152
152
|
? [
|
|
153
153
|
{ label: 'Home', href: '/' },
|
|
154
|
-
{ label: 'Posts', href: '/
|
|
154
|
+
{ label: 'Posts', href: '/posts' },
|
|
155
155
|
{ label: 'Topics', href: '/topics' }
|
|
156
156
|
]
|
|
157
157
|
: [
|
|
@@ -69,7 +69,7 @@ export function buildSitemapXml(
|
|
|
69
69
|
|
|
70
70
|
const urls: { loc: string; lastmod?: string }[] = [
|
|
71
71
|
{ loc: absoluteUrl(site, '/') },
|
|
72
|
-
...(site.homePage ? [{ loc: absoluteUrl(site, '/
|
|
72
|
+
...(site.homePage ? [{ loc: absoluteUrl(site, '/posts') }] : []),
|
|
73
73
|
{ loc: absoluteUrl(site, '/topics') },
|
|
74
74
|
{ loc: absoluteUrl(site, '/tags') },
|
|
75
75
|
...extraPages,
|
package/scripts/filepress.mjs
CHANGED
|
File without changes
|
package/packages/app/README.md
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
# @filepress/app
|
|
2
|
-
|
|
3
|
-
The only SvelteKit application in the filepress monorepo. All routes, layouts, and
|
|
4
|
-
Kit wiring live here. Content sites under [`../../sites`](../../sites) provide:
|
|
5
|
-
|
|
6
|
-
- `filepress.config.ts` — identity
|
|
7
|
-
- `posts/` — Markdown
|
|
8
|
-
- `static/` — favicon, images (optional)
|
|
9
|
-
|
|
10
|
-
## Run against a site
|
|
11
|
-
|
|
12
|
-
From the repo root (do not run vite directly without `FILEPRESS_SITE_ROOT`):
|
|
13
|
-
|
|
14
|
-
```bash
|
|
15
|
-
pnpm filepress dev --site demo
|
|
16
|
-
pnpm filepress build --site demo
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
Build output is written to `sites/<name>/build/`.
|
package/packages/core/README.md
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
# @filepress/core
|
|
2
|
-
|
|
3
|
-
The reusable filepress engine. Sites under [`../../sites`](../../sites) depend on
|
|
4
|
-
it (via `workspace:*` in this monorepo) and provide their own SvelteKit routes,
|
|
5
|
-
content, and `filepress.config.ts`.
|
|
6
|
-
|
|
7
|
-
## Entry points
|
|
8
|
-
|
|
9
|
-
- `@filepress/core` — client-safe: `PostCard`, `PostIndex`, `Newsletter`,
|
|
10
|
-
`SiteHeader`, `SiteFooter`, `defineFilepressConfig`, `absoluteUrl`,
|
|
11
|
-
`formatDate`, and shared types.
|
|
12
|
-
- `@filepress/core/server` — server-only (filesystem access): `createContent`,
|
|
13
|
-
`renderMarkdown`, `buildRssXml` / `buildSitemapXml` / `buildRobotsTxt`, and the
|
|
14
|
-
content-parsing primitives. Import only from `+page.server.ts`, `+server.ts`,
|
|
15
|
-
or `*.server.ts` modules.
|
|
16
|
-
- `@filepress/core/theme` — self-hosted fonts + the Essay theme CSS. Import once
|
|
17
|
-
from a site's root layout.
|
|
18
|
-
|
|
19
|
-
## Why routes live in the site
|
|
20
|
-
|
|
21
|
-
SvelteKit's router is per-project, so each site owns its `src/routes/`. Those
|
|
22
|
-
route files stay thin: they call `createContent(...)` + core builders and render
|
|
23
|
-
core components. `scripts/create-site.mjs` scaffolds them.
|
|
24
|
-
|
|
25
|
-
## Testing
|
|
26
|
-
|
|
27
|
-
`pnpm --filter @filepress/core test` runs the unit tests over the pure parsing
|
|
28
|
-
and figure-transform logic. Type-checking of the whole library happens through
|
|
29
|
-
each site's `svelte-check`.
|