getfilepress 0.1.21 → 0.1.22
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
CHANGED
|
@@ -4,7 +4,7 @@ Markdown blogs from git. No CMS. No database. A static `build/` folder.
|
|
|
4
4
|
|
|
5
5
|
Written **FilePress**. npm **`getfilepress`**. CLI **`filepress`** (same script as `getfilepress`).
|
|
6
6
|
|
|
7
|
-
**Site:** [getfilepress.com](https://getfilepress.com) · **Docs:** [
|
|
7
|
+
**Site:** [getfilepress.com](https://getfilepress.com) · **Docs:** [getfilepress.com/docs](https://getfilepress.com/docs)
|
|
8
8
|
|
|
9
9
|
## Start a site
|
|
10
10
|
|
|
@@ -16,7 +16,7 @@ pnpm create-site my-blog --external ../my-blog --title "My Blog" --url https://m
|
|
|
16
16
|
cd ../my-blog && pnpm install && pnpm dev
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
`filepress new "Title"` stamps `posts/YYYY-MM-DD-slug.md`. Config, frontmatter, images, and commands: [
|
|
19
|
+
`filepress new "Title"` stamps `posts/YYYY-MM-DD-slug.md`. Config, frontmatter, images, and commands: [Docs](https://getfilepress.com/docs).
|
|
20
20
|
|
|
21
21
|
Pin CI on npm (`getfilepress` current is `0.1.19`) or a git SHA / existing tag. `link:` is local only.
|
|
22
22
|
|
|
@@ -33,7 +33,7 @@ Crawls a public site (sitemap/RSS preferred) into a sibling content tree. Option
|
|
|
33
33
|
|
|
34
34
|
| Topic | Where |
|
|
35
35
|
| --- | --- |
|
|
36
|
-
| Scaffold, config, posts | [
|
|
36
|
+
| Scaffold, config, posts | [Docs](https://getfilepress.com/docs) · [getting started](https://getfilepress.com/docs/getting-started) |
|
|
37
37
|
| Theme tokens and presets | [docs/THEME.md](docs/THEME.md) |
|
|
38
38
|
| Genie (dev only) | [Genie](https://getfilepress.com/genie) · [spec](docs/GENIE_MODE_SPEC.md) |
|
|
39
39
|
| Deploy | [Deploy](https://getfilepress.com/deploy) · [docs/DEPLOY.md](docs/DEPLOY.md) |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "getfilepress",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.22",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "FilePress — file-based Markdown blog engine. Link this package from a content-only site (config + posts), then run `filepress build`.",
|
|
@@ -55,13 +55,14 @@
|
|
|
55
55
|
"check": "pnpm filepress check --site demo",
|
|
56
56
|
"build": "pnpm filepress build --site demo",
|
|
57
57
|
"build:demo": "pnpm filepress build --site demo",
|
|
58
|
-
"
|
|
58
|
+
"docs:www": "node sites/getfilepress/docs/build.mjs",
|
|
59
|
+
"build:www": "pnpm docs:www && pnpm filepress build --site getfilepress",
|
|
59
60
|
"ship": "pnpm build:www && wrangler pages deploy sites/getfilepress/build --project-name getfilepress",
|
|
60
61
|
"deploy:www": "pnpm ship",
|
|
61
62
|
"dev": "node scripts/ensure-lease.mjs demo 5179 && pnpm filepress dev --site demo --host 0.0.0.0",
|
|
62
63
|
"serve": "node scripts/ensure-lease.mjs demo 5179 && pnpm filepress dev --site demo --host 0.0.0.0",
|
|
63
64
|
"dev:demo": "node scripts/ensure-lease.mjs demo 5179 && pnpm filepress dev --site demo --host 0.0.0.0",
|
|
64
|
-
"dev:www": "node scripts/ensure-lease.mjs getfilepress 5180 && pnpm filepress dev --site getfilepress --host 0.0.0.0",
|
|
65
|
+
"dev:www": "pnpm docs:www && node scripts/ensure-lease.mjs getfilepress 5180 && pnpm filepress dev --site getfilepress --host 0.0.0.0",
|
|
65
66
|
"create-site": "node scripts/create-site.mjs",
|
|
66
67
|
"sync-siblings": "tsx scripts/sync-sibling-sites.ts",
|
|
67
68
|
"siblings": "tsx scripts/siblings/server.ts",
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import { redirect } from '@sveltejs/kit';
|
|
2
1
|
import type { PageServerLoad } from './$types';
|
|
3
|
-
import {
|
|
2
|
+
import { redirect } from '@sveltejs/kit';
|
|
3
|
+
import { content } from '$lib/content.server';
|
|
4
4
|
import config from '$site-config';
|
|
5
5
|
|
|
6
6
|
export const load: PageServerLoad = () => {
|
|
7
|
-
|
|
7
|
+
if (!config.homePage) {
|
|
8
|
+
redirect(302, '/');
|
|
9
|
+
}
|
|
10
|
+
return content.getIndexPage(1, config.postsPerPage);
|
|
8
11
|
};
|
|
@@ -1 +1,37 @@
|
|
|
1
|
-
<
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { PageData } from './$types';
|
|
3
|
+
import { PostIndex, absoluteUrl, ogImageUrl } from '@filepress/core';
|
|
4
|
+
import config from '$site-config';
|
|
5
|
+
|
|
6
|
+
let { data }: { data: PageData } = $props();
|
|
7
|
+
|
|
8
|
+
const pageTitle = $derived(`Writing — ${config.title}`);
|
|
9
|
+
const canonical = $derived(absoluteUrl(config, '/writing'));
|
|
10
|
+
const ogImage = $derived(ogImageUrl(config));
|
|
11
|
+
const description = $derived(`Writing from ${config.title}. ${config.description}`.trim());
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<svelte:head>
|
|
15
|
+
<title>{pageTitle}</title>
|
|
16
|
+
<meta name="description" content={description} />
|
|
17
|
+
<link rel="canonical" href={canonical} />
|
|
18
|
+
<meta property="og:type" content="website" />
|
|
19
|
+
<meta property="og:title" content="Writing — {config.title}" />
|
|
20
|
+
<meta property="og:description" content={description} />
|
|
21
|
+
<meta property="og:url" content={canonical} />
|
|
22
|
+
{#if ogImage}
|
|
23
|
+
<meta property="og:image" content={ogImage} />
|
|
24
|
+
<meta name="twitter:card" content="summary" />
|
|
25
|
+
<meta name="twitter:image" content={ogImage} />
|
|
26
|
+
{/if}
|
|
27
|
+
</svelte:head>
|
|
28
|
+
|
|
29
|
+
<PostIndex
|
|
30
|
+
site={config}
|
|
31
|
+
featured={data.featured}
|
|
32
|
+
posts={data.posts}
|
|
33
|
+
page={data.page}
|
|
34
|
+
totalPages={data.totalPages}
|
|
35
|
+
indexHref="/writing"
|
|
36
|
+
heading="Writing"
|
|
37
|
+
/>
|
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
page = 1,
|
|
13
13
|
totalPages = 1,
|
|
14
14
|
/** Page-1 URL for the post index (`/` or `/posts`). */
|
|
15
|
-
indexHref = '/'
|
|
15
|
+
indexHref = '/',
|
|
16
|
+
heading = 'Posts'
|
|
16
17
|
}: {
|
|
17
18
|
site: SiteConfig;
|
|
18
19
|
hero?: boolean;
|
|
@@ -21,6 +22,7 @@
|
|
|
21
22
|
page?: number;
|
|
22
23
|
totalPages?: number;
|
|
23
24
|
indexHref?: string;
|
|
25
|
+
heading?: string;
|
|
24
26
|
} = $props();
|
|
25
27
|
|
|
26
28
|
const hasContent = $derived(featured !== null || posts.length > 0);
|
|
@@ -40,9 +42,9 @@
|
|
|
40
42
|
{:else}
|
|
41
43
|
<header class="post-header">
|
|
42
44
|
{#if page <= 1}
|
|
43
|
-
<h1>
|
|
45
|
+
<h1>{heading}</h1>
|
|
44
46
|
{:else}
|
|
45
|
-
<p class="eyebrow">
|
|
47
|
+
<p class="eyebrow">{heading}</p>
|
|
46
48
|
<h1>Page {page}</h1>
|
|
47
49
|
{/if}
|
|
48
50
|
</header>
|
|
@@ -59,10 +59,7 @@ export function mergeRedirects(existing: string, extra: RedirectRule[]): string
|
|
|
59
59
|
|
|
60
60
|
/** When `/` is a landing page, old `/writing` indexes used to hold the post list. */
|
|
61
61
|
export function writingPostRedirects(): RedirectRule[] {
|
|
62
|
-
return [
|
|
63
|
-
{ from: '/writing', to: '/posts', status: 308 },
|
|
64
|
-
{ from: '/writing/*', to: '/posts/:splat', status: 301 }
|
|
65
|
-
];
|
|
62
|
+
return [{ from: '/writing/*', to: '/posts/:splat', status: 301 }];
|
|
66
63
|
}
|
|
67
64
|
|
|
68
65
|
export function redirectsFromSourceUrls(
|