mdorigin 0.4.1 → 0.5.1
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 +4 -4
- package/dist/adapters/cloudflare.js +2 -0
- package/dist/cli/build-index.js +3 -0
- package/dist/core/extensions.d.ts +13 -0
- package/dist/core/request-handler.js +420 -12
- package/dist/core/router.d.ts +9 -0
- package/dist/core/router.js +26 -0
- package/dist/core/site-config.d.ts +53 -0
- package/dist/core/site-config.js +127 -0
- package/dist/core/site-url.d.ts +2 -0
- package/dist/core/site-url.js +6 -0
- package/dist/html/template.d.ts +17 -0
- package/dist/html/template.js +76 -33
- package/dist/html/theme.js +29 -0
- package/dist/i18n/messages.d.ts +45 -0
- package/dist/i18n/messages.js +104 -0
- package/dist/index-builder.d.ts +3 -1
- package/dist/index-builder.js +8 -2
- package/dist/search.js +1 -6
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -23,7 +23,7 @@ That means `mdorigin` should own content semantics, while page rendering remains
|
|
|
23
23
|
- extensionless routes render human-friendly HTML from the same files
|
|
24
24
|
- `README.md`, `index.md`, and `SKILL.md` all fit into one routing model
|
|
25
25
|
- the same core works in local preview and Cloudflare Workers
|
|
26
|
-
- optional search is powered by [`indexbind`](https://github.com/
|
|
26
|
+
- optional search is powered by [`indexbind`](https://github.com/holon-run/indexbind)
|
|
27
27
|
|
|
28
28
|
## Install
|
|
29
29
|
|
|
@@ -87,7 +87,7 @@ The intended boundary is:
|
|
|
87
87
|
|
|
88
88
|
## Optional Search
|
|
89
89
|
|
|
90
|
-
`mdorigin` can build a local retrieval bundle through the optional [`indexbind`](https://github.com/
|
|
90
|
+
`mdorigin` can build a local retrieval bundle through the optional [`indexbind`](https://github.com/holon-run/indexbind) package. For the retrieval engine itself, see the `indexbind` docs: <https://indexbind.jolestar.workers.dev>.
|
|
91
91
|
|
|
92
92
|
```bash
|
|
93
93
|
npm install indexbind
|
|
@@ -127,7 +127,7 @@ Runtime endpoints:
|
|
|
127
127
|
|
|
128
128
|
## Docs
|
|
129
129
|
|
|
130
|
-
- Docs site: <https://mdorigin.
|
|
130
|
+
- Docs site: <https://mdorigin.holon.run>
|
|
131
131
|
- Getting started: [`docs/site/guides/getting-started.md`](docs/site/guides/getting-started.md)
|
|
132
132
|
- Routing model: [`docs/site/concepts/routing.md`](docs/site/concepts/routing.md)
|
|
133
133
|
- Directory indexes: [`docs/site/concepts/directory-indexes.md`](docs/site/concepts/directory-indexes.md)
|
|
@@ -136,4 +136,4 @@ Runtime endpoints:
|
|
|
136
136
|
- Search setup: [`docs/site/guides/getting-started.md`](docs/site/guides/getting-started.md#quick-start)
|
|
137
137
|
- Cloudflare deployment: [`docs/site/guides/cloudflare.md`](docs/site/guides/cloudflare.md)
|
|
138
138
|
|
|
139
|
-
The docs site at <https://mdorigin.
|
|
139
|
+
The docs site at <https://mdorigin.holon.run> is deployed automatically from `main` with GitHub Actions.
|
package/dist/cli/build-index.js
CHANGED
|
@@ -23,6 +23,9 @@ export async function runBuildIndexCommand(argv) {
|
|
|
23
23
|
rootDir,
|
|
24
24
|
dir,
|
|
25
25
|
plugins: loadedConfig.plugins,
|
|
26
|
+
excludedDirectories: (loadedConfig.siteConfig.locales ?? [])
|
|
27
|
+
.filter((locale) => locale.contentBase !== '')
|
|
28
|
+
.map((locale) => locale.contentBase),
|
|
26
29
|
});
|
|
27
30
|
console.log(`updated ${result.updatedFiles.length} index file(s)`);
|
|
28
31
|
if (result.skippedDirectories.length > 0) {
|
|
@@ -8,10 +8,23 @@ export interface IndexTransformContext {
|
|
|
8
8
|
sourcePath?: string;
|
|
9
9
|
siteConfig?: ResolvedSiteConfig;
|
|
10
10
|
}
|
|
11
|
+
export interface PageLanguage {
|
|
12
|
+
code: string;
|
|
13
|
+
label: string;
|
|
14
|
+
/** Root-relative href for this language: the translated page when available, otherwise the language home. */
|
|
15
|
+
href: string;
|
|
16
|
+
current: boolean;
|
|
17
|
+
/** Whether a page-level translation exists for this language. */
|
|
18
|
+
translated: boolean;
|
|
19
|
+
}
|
|
11
20
|
export interface PageRenderModel {
|
|
12
21
|
kind: 'page' | 'listing';
|
|
13
22
|
requestPath: string;
|
|
14
23
|
sourcePath: string;
|
|
24
|
+
/** Effective UI locale for this request (frontmatter overrides not applied). */
|
|
25
|
+
locale: string;
|
|
26
|
+
/** Language switcher entries; empty for single-language sites. */
|
|
27
|
+
languages: PageLanguage[];
|
|
15
28
|
siteTitle: string;
|
|
16
29
|
siteDescription?: string;
|
|
17
30
|
siteUrl?: string;
|