retypeset-odyssey 0.1.1 → 0.1.3

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
@@ -17,12 +17,13 @@ Other deltas from upstream: trilingual content support (zh / en / ja) with `.en.
17
17
 
18
18
  ## Features
19
19
 
20
- - Built with Astro 5 and UnoCSS
20
+ - Built with Astro 6 and UnoCSS
21
21
  - SEO, Sitemap, OpenGraph (with generated cards), RSS, MDX, LaTeX, Mermaid, TOC
22
- - i18n with route-level language switching
22
+ - i18n with route-level language switching and per-language tagline / collection-intro overrides
23
23
  - Light / Dark mode with view transitions
24
24
  - Pagefind full-text search
25
25
  - Responsive, typography-first layout
26
+ - Folder-based content collections — drop a new folder under `content/` and you get list + detail routes for free
26
27
 
27
28
  ## Usage A — Standalone (fork & clone)
28
29
 
@@ -49,12 +50,14 @@ Set up your own minimal Astro project that consumes this theme. One install, one
49
50
  "build": "astro build"
50
51
  },
51
52
  "dependencies": {
52
- "astro": "^5.17.1",
53
- "retypeset-odyssey": "github:lifeodyssey/retypeset-odyssey"
53
+ "astro": "^6.3.7",
54
+ "retypeset-odyssey": "^0.1.3"
54
55
  }
55
56
  }
56
57
  ```
57
58
 
59
+ (You can also pin to the GitHub tarball with `"retypeset-odyssey": "github:lifeodyssey/retypeset-odyssey"` if you want to track an unreleased branch.)
60
+
58
61
  ```ts
59
62
  // astro.config.ts
60
63
  import { defineConfig } from 'astro/config'
@@ -69,17 +72,39 @@ export default defineConfig({
69
72
  # retypeset.config.yaml — at project root. Any subset of keys; the rest fall back to defaults.
70
73
  site:
71
74
  title: My Blog
72
- subtitle: Hello world
75
+ # `subtitle` accepts either a single string (used for all languages) or a
76
+ # per-language map. The map form is recommended for multilingual sites.
77
+ subtitle:
78
+ en: A journey through ideas
79
+ zh: 一段关于想法的旅程
80
+ ja: アイデアの旅
73
81
  author: Your Name
74
82
  url: https://your-domain.com
75
83
  global:
76
84
  locale: en
77
- moreLocales: []
85
+ moreLocales: [] # for multilingual sites add e.g. [zh, ja]
78
86
  footer:
79
87
  links:
80
88
  - name: RSS
81
89
  url: /atom.xml
82
90
  startYear: 2024
91
+
92
+ # Per-collection settings. The built-in `posts`, `notes`, `journals`
93
+ # collections are enabled by default. Set `enabled: false` to drop one.
94
+ # `intro` is an optional per-language tagline shown under the collection
95
+ # title on its list page (e.g. /notes, /journals); if you omit it the
96
+ # generic fallback from src/i18n/ui.ts is used instead.
97
+ collections:
98
+ notes:
99
+ intro:
100
+ en: My notes
101
+ zh: 我的笔记
102
+ ja: 私のノート
103
+ journals:
104
+ intro:
105
+ en: Personal diary entries
106
+ zh: 个人日记
107
+ ja: 個人的な日記
83
108
  ```
84
109
 
85
110
  ```ts
@@ -116,12 +141,16 @@ pnpm build # → dist/
116
141
 
117
142
  ### Configuration reference
118
143
 
119
- The full schema lives in [`src/config-schema.ts`](./src/config-schema.ts) and the defaults in [`default-config.yaml`](./default-config.yaml). Top-level groups: `site`, `color`, `global`, `comment`, `seo`, `footer`, `preload`. Any field you do not set in your YAML falls back to the default. Validation errors surface at `astro build` time with a clear path into the YAML.
144
+ The full schema lives in [`src/config-schema.ts`](./src/config-schema.ts) and the defaults in [`default-config.yaml`](./default-config.yaml). Top-level groups: `site`, `color`, `global`, `comment`, `seo`, `footer`, `preload`, `collections`. Any field you do not set in your YAML falls back to the default. Validation errors surface at `astro build` time with a clear path into the YAML.
145
+
146
+ ### Folder-based collections
147
+
148
+ Drop any folder under `content/` (e.g. `content/tech/`) and the integration will auto-discover it, generate `/tech` as the list page and `/tech/<slug>` as detail pages — no code change needed. Folders prefixed with `_` or `.` are ignored, so `content/_drafts/` is a natural place to stash in-progress work. Disable a folder by setting `collections.<name>.enabled: false`, and give it a per-language tagline with `collections.<name>.intro.{zh,en,ja}` just like the built-ins.
120
149
 
121
150
  ## Customization
122
151
 
123
152
  - **Site config**: edit `default-config.yaml` (standalone) or write your own `retypeset.config.yaml` next to `astro.config.ts` (package consumers). Any subset of keys is allowed; the rest fall back to the defaults.
124
- - **About pages**: place markdown in `src/content/about/about-{zh|en|ja}.md`.
153
+ - **About pages**: place markdown in `content/about/about-{zh|en|ja}.md` (the `lang` field in the frontmatter picks which language each file belongs to).
125
154
  - **Static assets** (favicon, OG logo, fonts): standalone users edit `public/`; package consumers inherit from the installed theme.
126
155
 
127
156
  ## Migrating from Hexo
package/integration.ts CHANGED
@@ -363,6 +363,15 @@ export const dynamicCollections = ${JSON.stringify(dynamicFolders)}
363
363
  return virtualConfigCode
364
364
  if (id === RESOLVED_DYNAMIC_VIRTUAL_ID)
365
365
  return dynamicCollectionsCode
366
+ // Astro 6 / Vite 7's built-in alias plugin (also
367
+ // `enforce: 'pre'`) rewrites `@/config` to the absolute
368
+ // path of the standalone fallback before our resolveId
369
+ // sees the unresolved specifier. Intercept the load by
370
+ // file path too so the consumer-merged config always wins
371
+ // over the inline TS defaults in src/config.ts.
372
+ const configFile = themePath('./src/config.ts')
373
+ if (id === configFile || id.startsWith(`${configFile}?`))
374
+ return virtualConfigCode
366
375
  return null
367
376
  },
368
377
  },
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "retypeset-odyssey",
3
3
  "type": "module",
4
- "version": "0.1.1",
4
+ "version": "0.1.3",
5
5
  "packageManager": "pnpm@10.26.0",
6
6
  "repository": "https://github.com/lifeodyssey/retypeset-odyssey",
7
7
  "exports": {