create-presmium 1.0.0-rc.2 → 1.0.0-rc.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-presmium",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.3",
|
|
4
4
|
"description": "presmium new, or pnpm create presmium: a new Presmium lecture, workspace or plugin",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -38,10 +38,10 @@
|
|
|
38
38
|
],
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"jiti": "^2.7.0",
|
|
41
|
-
"@lincyaw/kernel": "1.0.0-rc.
|
|
41
|
+
"@lincyaw/kernel": "1.0.0-rc.3"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@lincyaw/cli": "1.0.0-rc.
|
|
44
|
+
"@lincyaw/cli": "1.0.0-rc.3"
|
|
45
45
|
},
|
|
46
46
|
"presmium": {
|
|
47
47
|
"generated": [
|
package/src/messages.ts
CHANGED
|
@@ -84,7 +84,7 @@ export const MESSAGES: Record<Locale, Messages> = {
|
|
|
84
84
|
guideStartTitle: '写下第一篇内容',
|
|
85
85
|
guideStartBody: '网站首页单独编排,课程文章保存在教学文稿中。替换示例内容,再在新的子目录中新建文稿,具体文件与命令见项目的 README。',
|
|
86
86
|
guideStyleTitle: '选择网站主题',
|
|
87
|
-
guideStyleBody: '在 presmium.workspace.yaml 的 site 中设置 theme:course 适合课程,docs 适合文档,showcase 适合展示作品。params 可以调整 accent、typography 和 contentWidth
|
|
87
|
+
guideStyleBody: '在 presmium.workspace.yaml 的 site 中设置 theme:course 适合课程,docs 适合文档,showcase 适合展示作品。params 可以调整 accent、typography 和 contentWidth;theme 写成主题目录(如 ./theme)时,可以自定义配色、字体与样式。',
|
|
88
88
|
guidePublishTitle: '发布你的网站',
|
|
89
89
|
guidePublishBody: '导出网站后,静态产物在 dist/web/。将项目推送到 GitHub,并在仓库的 Pages 设置中选择 GitHub Actions,项目附带的工作流会在 main 分支更新时导出和发布。',
|
|
90
90
|
},
|
|
@@ -100,7 +100,7 @@ pnpm check # 检查教学文稿
|
|
|
100
100
|
pnpm build # 导出网站到 dist/web/
|
|
101
101
|
\`\`\`
|
|
102
102
|
|
|
103
|
-
在 \`site.theme\` 中选择 \`course\`、\`docs\` 或 \`showcase\`,在 \`site.params\` 中调整 \`accent\`、\`typography\` 与 \`contentWidth
|
|
103
|
+
在 \`site.theme\` 中选择 \`course\`、\`docs\` 或 \`showcase\`,在 \`site.params\` 中调整 \`accent\`、\`typography\` 与 \`contentWidth\`。需要自己的配色、字体与样式时,把 \`site.theme\` 写成主题目录(如 \`./theme\`),在其中的 \`theme.json\` 中设置设计令牌与样式表。
|
|
104
104
|
|
|
105
105
|
默认首页入口是 \`site.landing: { source: './site/home.json' }\`。需要自行设计 HTML 首页时,创建 \`site/home.html\` 并改为 \`site.landing: { template: './site/home.html' }\`;教学文稿继续使用各目录中的 \`lecture.json\`。
|
|
106
106
|
|
|
@@ -224,7 +224,7 @@ Options:
|
|
|
224
224
|
guideStartTitle: 'Write your first article',
|
|
225
225
|
guideStartBody: 'Design your website home page separately from the teaching documents that hold your articles. Replace the sample content, then add documents in new subdirectories. The project’s README lists the files and commands.',
|
|
226
226
|
guideStyleTitle: 'Choose Your Site Style',
|
|
227
|
-
guideStyleBody: 'Set theme under site in presmium.workspace.yaml: course for courses, docs for documentation, or showcase for your projects. Use params to adjust accent, typography, and contentWidth.',
|
|
227
|
+
guideStyleBody: 'Set theme under site in presmium.workspace.yaml: course for courses, docs for documentation, or showcase for your projects. Use params to adjust accent, typography, and contentWidth; set theme to a theme directory (such as ./theme) for your own colors, fonts, and styles.',
|
|
228
228
|
guidePublishTitle: 'Share Your Site',
|
|
229
229
|
guidePublishBody: 'Export your site into dist/web/. Push the project to GitHub and choose GitHub Actions in the repository’s Pages settings. The included workflow exports and publishes changes to main.',
|
|
230
230
|
},
|
|
@@ -240,7 +240,7 @@ pnpm check # checks the teaching document
|
|
|
240
240
|
pnpm build # exports the website into dist/web/
|
|
241
241
|
\`\`\`
|
|
242
242
|
|
|
243
|
-
Choose \`course\`, \`docs\`, or \`showcase\` in \`site.theme\`. Adjust \`accent\`, \`typography\`, and \`contentWidth\` in \`site.params\`.
|
|
243
|
+
Choose \`course\`, \`docs\`, or \`showcase\` in \`site.theme\`. Adjust \`accent\`, \`typography\`, and \`contentWidth\` in \`site.params\`. For your own colors, fonts, and styles, set \`site.theme\` to a theme directory (such as \`./theme\`) and set design tokens and stylesheets in its \`theme.json\`.
|
|
244
244
|
|
|
245
245
|
The default home page is \`site.landing: { source: './site/home.json' }\`. To design it freely in HTML, create \`site/home.html\` and use \`site.landing: { template: './site/home.html' }\`. Teaching documents continue to use \`lecture.json\` in their own directories.
|
|
246
246
|
|
|
@@ -46,8 +46,27 @@ In the workspace configuration, `site.theme` selects `course`, `docs` or `showca
|
|
|
46
46
|
| `contentWidth` | `comfortable`, `wide` |
|
|
47
47
|
| `logo`, `logoAlt` | The logo location and alternative text |
|
|
48
48
|
|
|
49
|
+
For a look of its own, `site.theme` names a theme directory (`./theme`) or an installed theme package instead of a built-in id. The directory holds `theme.json`:
|
|
50
|
+
|
|
51
|
+
```json
|
|
52
|
+
{
|
|
53
|
+
"schemaVersion": 1,
|
|
54
|
+
"name": "pixel",
|
|
55
|
+
"extends": "docs",
|
|
56
|
+
"params": { "typography": "sans" },
|
|
57
|
+
"tokens": { "font-sans": "'IBM Plex Sans', system-ui, sans-serif", "color-bg": "#f6f6f1", "color-accent": "#2546b8", "radius-control": "0" },
|
|
58
|
+
"dark": { "color-bg": "#121216", "color-accent": "#8ea6ff" },
|
|
59
|
+
"fonts": ["https://fonts.googleapis.com/css2?family=Silkscreen&display=swap"],
|
|
60
|
+
"styles": ["./pixel.css"]
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
`extends` picks the built-in layouts (default `docs`); `params` are defaults under the site's own `site.params`. `tokens` set design tokens by their name without `--pm-` (the build rejects unknown names); colors and shadows there are the light appearance's, and `dark` sets the dark ones, falling back to the built-in dark values. `fonts` are `https:` stylesheet URLs; `styles` are CSS files in the theme directory, which may use relative `url()`s to the directory's fonts and images. Every page carries `data-pm-site-theme-name="<name>"`, so a stylesheet scopes its rules with `[data-pm-site-theme-name='pixel']`. An HTML template homepage receives the stylesheets in the site data (`site.theme.stylesheets`) to link them itself. A theme package sets `presmium.theme` in its `package.json` to the directory with `theme.json`, or keeps `theme.json` at its root.
|
|
65
|
+
|
|
49
66
|
Keep each teaching document's page layout in `metadata.renderers.web.layout`: `article` (default), `landing` (all sections combined into one full-width HTML page without sidebars or page navigation), or `wide` (wider content without the right outline). Each translation uses its own layout, defaulting to `article` when omitted; it does not inherit the original's layout. A standalone document can select `theme` and `params` in its own `metadata.renderers.web`; do not use document themes to override the shared shell of a workspace site. A string `site.landing` adds a full-document root page without changing the original document's pagination; a document's own `layout: landing` changes that pagination. Independent site page content stays separate. Templates do not alter authored block/step identities, narration or production settings.
|
|
50
67
|
|
|
68
|
+
A workspace build also builds the presentation of every document whose `metadata.renderers` lists `slides` or `lecture`: `<dir>/slides/` and `<dir>/lecture/` beside its pages. A template homepage can play a narrated document in an iframe at `<dir>/slides/?view=present&track=script&autoplay`, starting at a step with `section=<id>&step=<n>`.
|
|
69
|
+
|
|
51
70
|
After changing website settings in `presmium.workspace.yaml`, restart `pnpm serve` for preview or run `pnpm build` again for the output. Existing serve sessions do not reload the workspace's website configuration.
|
|
52
71
|
|
|
53
72
|
`pnpm build` in the generated site writes `dist/web/`. Its `.github/workflows/pages.yml` reads GitHub Pages' base path, builds and deploys that directory after the repository's Pages source is set to GitHub Actions. Other hosts can serve the same static output. Check the real deployed root and an inner-page direct link, plus search and media; a successful local build does not verify the deployment path.
|