docpensieve 0.2.0 → 0.3.0-beta.2
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 +5 -5
- package/src/commands/init.js +5 -0
- package/starter/01-guide/01-installation.md +3 -3
- package/starter/01-guide/03-writing-pages.md +40 -0
- package/starter/01-guide/07-migrate-to-beta.md +37 -0
- package/starter/01-guide/index.md +1 -14
- package/starter/02-components/10-cards.mdx +76 -0
- package/starter/02-components/index.mdx +1 -9
- package/starter/03-reference/02-configuration.md +16 -0
- package/starter/03-reference/03-frontmatter.md +12 -12
- package/starter/03-reference/05-api.md +81 -0
- package/starter/03-reference/index.md +1 -7
- package/starter/05-whats-new.md +24 -64
- package/starter/01-guide/07-migrate-from-0-1.md +0 -57
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "docpensieve",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0-beta.2",
|
|
4
4
|
"description": "DocPensieve command-line interface (init, build, check, dev, serve)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -24,10 +24,10 @@
|
|
|
24
24
|
"types"
|
|
25
25
|
],
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@docpensieve/components": "0.
|
|
28
|
-
"@docpensieve/core": "0.
|
|
29
|
-
"@docpensieve/shared": "0.
|
|
30
|
-
"@docpensieve/theme": "0.
|
|
27
|
+
"@docpensieve/components": "0.3.0-beta.2",
|
|
28
|
+
"@docpensieve/core": "0.3.0-beta.2",
|
|
29
|
+
"@docpensieve/shared": "0.3.0-beta.2",
|
|
30
|
+
"@docpensieve/theme": "0.3.0-beta.2",
|
|
31
31
|
"chalk": "^6.0.0",
|
|
32
32
|
"chokidar": "^5.0.0",
|
|
33
33
|
"commander": "^15.0.0"
|
package/src/commands/init.js
CHANGED
|
@@ -266,6 +266,11 @@ function renderConfig({ name, theme, siteUrl, version }) {
|
|
|
266
266
|
' // version folder.',
|
|
267
267
|
" sidebar: 'auto',",
|
|
268
268
|
'',
|
|
269
|
+
' // Authors described in a JSON file of each version folder: a name, a',
|
|
270
|
+
' // biography, an avatar, a link. Left empty, a page still shows the',
|
|
271
|
+
' // names its frontmatter gives, without the rest.',
|
|
272
|
+
" authors: '',",
|
|
273
|
+
'',
|
|
269
274
|
' // The shipped components — Card, Columns, Tooltip… — usable in any .mdx',
|
|
270
275
|
' // page without an import. false removes them, to use your own names.',
|
|
271
276
|
' globalComponents: true,',
|
|
@@ -99,9 +99,9 @@ The documentation `init` installed in `99-docpensieve` stays at the version it
|
|
|
99
99
|
came with. To refresh it, run `init` in a scratch folder and copy that folder
|
|
100
100
|
over.
|
|
101
101
|
|
|
102
|
-
Coming from the 0.
|
|
103
|
-
changes on its own and what to check first. To try
|
|
104
|
-
|
|
102
|
+
Coming from the 0.2, [Migrate from latest to beta](./migrate-to-beta/) says
|
|
103
|
+
what changes on its own and what to check first. To try this beta, install
|
|
104
|
+
`docpensieve@beta`, or run `npx docpensieve@beta` alone.
|
|
105
105
|
|
|
106
106
|
## Checking
|
|
107
107
|
|
|
@@ -31,6 +31,46 @@ without `title`, the project name stands in.
|
|
|
31
31
|
|
|
32
32
|
The fields are detailed in the [reference](../reference/frontmatter/).
|
|
33
33
|
|
|
34
|
+
## Who wrote the page
|
|
35
|
+
|
|
36
|
+
A page that names its authors, or carries a date, opens with a byline:
|
|
37
|
+
|
|
38
|
+
```yaml
|
|
39
|
+
---
|
|
40
|
+
title: Installation
|
|
41
|
+
authors: [ada, grace]
|
|
42
|
+
date: 2026-09-09
|
|
43
|
+
modified: 2026-09-16
|
|
44
|
+
---
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
The names show as written. To give them a biography, an avatar and a link,
|
|
48
|
+
describe them in a JSON file of the version folder:
|
|
49
|
+
|
|
50
|
+
```json
|
|
51
|
+
{
|
|
52
|
+
"ada": {
|
|
53
|
+
"name": "Ada Lovelace",
|
|
54
|
+
"bio": "Wrote the first algorithm meant for a machine.",
|
|
55
|
+
"avatar": "authors/ada.png",
|
|
56
|
+
"url": "https://example.com/ada"
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Then name that file in the configuration: `authors: 'authors.json'`. It is
|
|
62
|
+
read **in each version folder**, as the menu is — a biography corrected in
|
|
63
|
+
the version being written leaves the published one alone. The file itself is
|
|
64
|
+
not published; the avatars are, and are measured at the build so that the
|
|
65
|
+
text does not jump when they arrive.
|
|
66
|
+
|
|
67
|
+
A key nobody describes is shown as written, which is what lets a project name
|
|
68
|
+
its authors before describing them. The description also feeds the page data:
|
|
69
|
+
a biography becomes the `description` of its `Person`, a link its `url`.
|
|
70
|
+
|
|
71
|
+
A date written the day the page was is not repeated as an update, and a home
|
|
72
|
+
page carries no byline at all: it is an entrance hall, not a document.
|
|
73
|
+
|
|
34
74
|
## What the URL depends on
|
|
35
75
|
|
|
36
76
|
The file path gives the URL path, stripped of its extension and of its sorting
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Migrate from latest to beta
|
|
3
|
+
description: Move a project from the latest version, the 0.2, to the 0.3 beta — what changes on its own, and what to check.
|
|
4
|
+
tags: [guide, migration]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Migrate from latest to beta
|
|
8
|
+
|
|
9
|
+
A project on the latest version — the 0.2 — builds with the 0.3 beta as it is:
|
|
10
|
+
every new field is optional.
|
|
11
|
+
|
|
12
|
+
## Update
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm install docpensieve@beta
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Through `npx` alone, `npx docpensieve@beta` runs the beta. Going back is
|
|
19
|
+
`npm install docpensieve@latest`.
|
|
20
|
+
|
|
21
|
+
## What changes on its own
|
|
22
|
+
|
|
23
|
+
| What | In 0.3 |
|
|
24
|
+
| ------------------------------------------ | ----------------------------------------------- |
|
|
25
|
+
| Pages with `authors`, `date` or `modified` | Open with a byline naming the authors and dates |
|
|
26
|
+
|
|
27
|
+
Nothing to change, but something to know: those three fields already existed,
|
|
28
|
+
read by the sitemap and the page data without ever being shown. They are now
|
|
29
|
+
shown, so a page that carries them gains a block it did not have. A page that
|
|
30
|
+
carries none of them looks exactly as before.
|
|
31
|
+
|
|
32
|
+
## What to turn on
|
|
33
|
+
|
|
34
|
+
| Field | Gives |
|
|
35
|
+
| ---------------------------- | ----------------------------------------------------- |
|
|
36
|
+
| `authors: 'authors.json'` | Biographies, avatars and links, described per version |
|
|
37
|
+
| `<Cards />` in an index page | A grid of cards built from the pages of the folder |
|
|
@@ -13,20 +13,7 @@ jsonld:
|
|
|
13
13
|
These pages are read in order. Each one starts from what the previous one set
|
|
14
14
|
up.
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
a project.
|
|
18
|
-
2. **[First site](./first-site/)** — build, serve, look at what was
|
|
19
|
-
produced.
|
|
20
|
-
3. **[Writing pages](./writing-pages/)** — frontmatter, URLs, menu, links,
|
|
21
|
-
images.
|
|
22
|
-
4. **[Versions](./versions/)** — several documentation versions, one
|
|
23
|
-
branch each.
|
|
24
|
-
5. **[Themes](./themes/)** — style the site, change the classes without
|
|
25
|
-
touching the HTML.
|
|
26
|
-
6. **[Deployment](./deployment/)** — publish, and keep past versions
|
|
27
|
-
online.
|
|
28
|
-
7. **[Migrate from 0.1 to 0.2](./migrate-from-0-1/)** — move a 0.1 project to
|
|
29
|
-
the 0.2.
|
|
16
|
+
<Cards />
|
|
30
17
|
|
|
31
18
|
## What to know first
|
|
32
19
|
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Cards
|
|
3
|
+
description: Grids of clickable cards, built from the pages of the version.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Cards
|
|
7
|
+
|
|
8
|
+
A folder is a **series**: its `index` page introduces it, and the pages beside
|
|
9
|
+
that index are its instalments. `Cards` turns that structure into a grid,
|
|
10
|
+
rather than a list written by hand — a hand-written index goes stale at the
|
|
11
|
+
first page renamed, and nothing says so.
|
|
12
|
+
|
|
13
|
+
## On this page
|
|
14
|
+
|
|
15
|
+
Placed in a page, the component lists what stands beside it. Here, the other
|
|
16
|
+
component pages:
|
|
17
|
+
|
|
18
|
+
<Cards />
|
|
19
|
+
|
|
20
|
+
```mdx
|
|
21
|
+
<Cards />
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Written in the `index` page of a folder, it lists that folder instead: a series
|
|
25
|
+
page shows its own instalments, not its neighbours.
|
|
26
|
+
|
|
27
|
+
## What a card carries
|
|
28
|
+
|
|
29
|
+
Everything comes from the pages themselves, nothing is declared twice:
|
|
30
|
+
|
|
31
|
+
| Shown | Read from |
|
|
32
|
+
| --------------- | -------------------------------------------------------------- |
|
|
33
|
+
| Title | `title` of the page |
|
|
34
|
+
| Description | `description` of the page |
|
|
35
|
+
| Image | `preview` of the page, resolved from the page that declares it |
|
|
36
|
+
| Number of pages | Counted under the folder — on a series card only |
|
|
37
|
+
| Update date | `modified`, or failing that `date` |
|
|
38
|
+
|
|
39
|
+
The **whole card is the link**, never the title alone: a card whose surface
|
|
40
|
+
does nothing invites a click that is lost.
|
|
41
|
+
|
|
42
|
+
## Narrowing the grid
|
|
43
|
+
|
|
44
|
+
| Prop | Effect |
|
|
45
|
+
| ----------- | -------------------------------------------------------------------- |
|
|
46
|
+
| `of` | `series` keeps the folders, `pages` keeps the pages beside the index |
|
|
47
|
+
| `from` | Reads another folder, named by its path within the version |
|
|
48
|
+
| `className` | Classes added to the grid |
|
|
49
|
+
| `style` | Inline styling, for a one-off adjustment |
|
|
50
|
+
|
|
51
|
+
```mdx
|
|
52
|
+
<Cards of="series" />
|
|
53
|
+
<Cards from="guide" />
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
`from` names a folder of **this** version, as it appears in a URL: `guide`, or
|
|
57
|
+
`guide/advanced`. It stops the build when nothing lives under that path, which
|
|
58
|
+
catches a typo rather than rendering an empty grid.
|
|
59
|
+
|
|
60
|
+
## Sizing
|
|
61
|
+
|
|
62
|
+
The grid fills the width it is given, with as many columns as fit. To hold it
|
|
63
|
+
narrower, set a width on the block — tokens and lengths work under both
|
|
64
|
+
themes, so this needs no variant:
|
|
65
|
+
|
|
66
|
+
```mdx
|
|
67
|
+
<div style={{ maxWidth: '32rem' }}>
|
|
68
|
+
<Cards of="series" />
|
|
69
|
+
</div>
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Without JavaScript
|
|
73
|
+
|
|
74
|
+
Like every component here, the grid is built at the build. What reaches the
|
|
75
|
+
reader is a list of links: it works with JavaScript turned off, and a card
|
|
76
|
+
never waits for anything to become clickable.
|
|
@@ -63,15 +63,7 @@ changes the examples too.
|
|
|
63
63
|
|
|
64
64
|
## Available
|
|
65
65
|
|
|
66
|
-
|
|
67
|
-
- [Columns](./columns/) — column grid
|
|
68
|
-
- [TimeTimer](./time-timer/) — display depending on a date
|
|
69
|
-
- [Tooltip](./tooltip/) — tooltip on hover and from the keyboard
|
|
70
|
-
- [Tree](./tree/) — collapsible tree
|
|
71
|
-
- [ScrollToTop](./scroll-to-top/) — back to the top of the page
|
|
72
|
-
- [Skill](./skill/) — level gauge
|
|
73
|
-
- [LogoIcon](./logo-icon/) — SVG icon inlined in the page
|
|
74
|
-
- [ForTheme](./for-theme/) — content kept for one theme only
|
|
66
|
+
<Cards />
|
|
75
67
|
|
|
76
68
|
## Without JavaScript
|
|
77
69
|
|
|
@@ -177,6 +177,22 @@ Longer rules go in the `theme/` folder, at the root of the project: every
|
|
|
177
177
|
`docpensieve dev` picks up every change. Under the `custom` theme, `init`
|
|
178
178
|
starts it with `theme/custom.css`.
|
|
179
179
|
|
|
180
|
+
## `authors`
|
|
181
|
+
|
|
182
|
+
```js
|
|
183
|
+
authors: 'authors.json',
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
Names a JSON file **read in each version folder**, describing the authors a
|
|
187
|
+
page names in its frontmatter: a name, a biography, an avatar, a link.
|
|
188
|
+
|
|
189
|
+
Empty by default, and then a page still shows the names it gives, without the
|
|
190
|
+
rest: the file enriches, it does not command. Named but missing, it stops the
|
|
191
|
+
build — leaving every biography out without a word would be worse.
|
|
192
|
+
|
|
193
|
+
The file is not published. The avatars are, their path starting at the version
|
|
194
|
+
folder so that they travel with it.
|
|
195
|
+
|
|
180
196
|
## `sidebar`
|
|
181
197
|
|
|
182
198
|
`'auto'` builds the menu from the file tree: folders become categories, and the
|
|
@@ -38,18 +38,18 @@ jsonld:
|
|
|
38
38
|
|
|
39
39
|
## The fields
|
|
40
40
|
|
|
41
|
-
| Field | Effect
|
|
42
|
-
| ------------- |
|
|
43
|
-
| `title` | `<title>` tag, menu entry, breadcrumb, JSON-LD `headline`
|
|
44
|
-
| `description` | `description` metadata and JSON-LD `description`
|
|
45
|
-
| `date` | Publication date
|
|
46
|
-
| `modified` | Last modification date. Default: the publication date
|
|
47
|
-
| `authors` |
|
|
48
|
-
| `tags` | Keywords, carried over as `keywords`
|
|
49
|
-
| `preview` | Image of the page. The path is resolved like a link
|
|
50
|
-
| `draft` | `true` keeps the page out of the output
|
|
51
|
-
| `layout` | `doc` (default) or `home`
|
|
52
|
-
| `jsonld` | Structured data settings
|
|
41
|
+
| Field | Effect |
|
|
42
|
+
| ------------- | -------------------------------------------------------------------------- |
|
|
43
|
+
| `title` | `<title>` tag, menu entry, breadcrumb, JSON-LD `headline` |
|
|
44
|
+
| `description` | `description` metadata and JSON-LD `description` |
|
|
45
|
+
| `date` | Publication date |
|
|
46
|
+
| `modified` | Last modification date. Default: the publication date. Shown in the byline |
|
|
47
|
+
| `authors` | Authors of the page, by name or by key of the version's author file |
|
|
48
|
+
| `tags` | Keywords, carried over as `keywords` |
|
|
49
|
+
| `preview` | Image of the page. The path is resolved like a link |
|
|
50
|
+
| `draft` | `true` keeps the page out of the output |
|
|
51
|
+
| `layout` | `doc` (default) or `home` |
|
|
52
|
+
| `jsonld` | Structured data settings |
|
|
53
53
|
|
|
54
54
|
## `layout`
|
|
55
55
|
|
|
@@ -488,6 +488,75 @@ that carries neither is listed without one rather than with a made-up date.
|
|
|
488
488
|
|
|
489
489
|
**Returns** `string`
|
|
490
490
|
|
|
491
|
+
### `buildAuthorTable`
|
|
492
|
+
|
|
493
|
+
`buildAuthorTable(description, options)`
|
|
494
|
+
|
|
495
|
+
Turns the JSON description of a version into a table of authors.
|
|
496
|
+
|
|
497
|
+
| Parameter | Type | |
|
|
498
|
+
| --- | --- | --- |
|
|
499
|
+
| `description` | `unknown` | Parsed content of the file. |
|
|
500
|
+
| `options` | `{ source: string }` | `source` names the file in errors. |
|
|
501
|
+
|
|
502
|
+
**Returns** `Map<string, Author>`
|
|
503
|
+
|
|
504
|
+
**Throws** `ConfigError` — When the shape is wrong, naming the offending entry.
|
|
505
|
+
|
|
506
|
+
### `buildByline`
|
|
507
|
+
|
|
508
|
+
`buildByline(frontmatter, [table], [where])`
|
|
509
|
+
|
|
510
|
+
Assembles what the head of a page shows, or nothing when it has none of it.
|
|
511
|
+
|
|
512
|
+
| Parameter | Type | |
|
|
513
|
+
| --- | --- | --- |
|
|
514
|
+
| `frontmatter` | `Record<string, any>` | |
|
|
515
|
+
| `[table]` | `Map<string, Author>` | |
|
|
516
|
+
| `[where]` | `string` | Page named in a date error. |
|
|
517
|
+
|
|
518
|
+
**Returns** `Byline \| null`
|
|
519
|
+
|
|
520
|
+
**Throws** `ConfigError` — When a date cannot be read.
|
|
521
|
+
|
|
522
|
+
### `readDate`
|
|
523
|
+
|
|
524
|
+
`readDate(value, field, where)`
|
|
525
|
+
|
|
526
|
+
Reads a date of the frontmatter, and gives it in both forms: the machine one
|
|
527
|
+
for `<time datetime>`, the readable one for the reader.
|
|
528
|
+
|
|
529
|
+
A date is often written unquoted in YAML, which parses it as a Date; quoted,
|
|
530
|
+
it arrives as text. Both are accepted, anything unreadable is refused rather
|
|
531
|
+
than shown as `Invalid Date`.
|
|
532
|
+
|
|
533
|
+
| Parameter | Type | |
|
|
534
|
+
| --- | --- | --- |
|
|
535
|
+
| `value` | `unknown` | |
|
|
536
|
+
| `field` | `string` | Name of the field, for the error message. |
|
|
537
|
+
| `where` | `string` | Page the date comes from. |
|
|
538
|
+
|
|
539
|
+
**Returns** `{ iso: string, label: string } \| null` — `null` when absent.
|
|
540
|
+
|
|
541
|
+
**Throws** `ConfigError` — When the value is not a date.
|
|
542
|
+
|
|
543
|
+
### `resolvePageAuthors`
|
|
544
|
+
|
|
545
|
+
`resolvePageAuthors(value, [table])`
|
|
546
|
+
|
|
547
|
+
The authors of a page, in the order the frontmatter names them.
|
|
548
|
+
|
|
549
|
+
A key the table does not describe is not an error: the name is shown as
|
|
550
|
+
written. It is what lets a project name its authors before describing them,
|
|
551
|
+
and what keeps pages written before the file working.
|
|
552
|
+
|
|
553
|
+
| Parameter | Type | |
|
|
554
|
+
| --- | --- | --- |
|
|
555
|
+
| `value` | `unknown` | `authors` from the frontmatter: one name or a list. |
|
|
556
|
+
| `[table]` | `Map<string, Author>` | |
|
|
557
|
+
|
|
558
|
+
**Returns** `Author[]`
|
|
559
|
+
|
|
491
560
|
## `@docpensieve/theme`
|
|
492
561
|
|
|
493
562
|
The theme providers and the engine that composes them.
|
|
@@ -642,6 +711,18 @@ itself (ADR-006).
|
|
|
642
711
|
| --- | --- | --- |
|
|
643
712
|
| `props` | `{ className?: string, style?: object, src?: string, alt?: string, title?: string, srcSet?: string, sizes?: string, loading?: 'lazy' \| 'eager', }` | `alt` defaults to the empty string: without that attribute, a screen reader would announce the file URL. |
|
|
644
713
|
|
|
714
|
+
### `Cards`
|
|
715
|
+
|
|
716
|
+
`Cards(props)`
|
|
717
|
+
|
|
718
|
+
Grid of cards for the children of a folder.
|
|
719
|
+
|
|
720
|
+
| Parameter | Type | |
|
|
721
|
+
| --- | --- | --- |
|
|
722
|
+
| `props` | `{ className?: string, style?: object, of?: 'all' \| 'series' \| 'pages', from?: string, }` | `of` narrows the grid to the sub-folders (`'series'`) or to the pages beside the index (`'pages'`); `from` reads another folder, named by its slug, instead of the one holding the page. |
|
|
723
|
+
|
|
724
|
+
**Throws** `Error` — When the page list is missing, or `from` names nothing.
|
|
725
|
+
|
|
645
726
|
### `Column`
|
|
646
727
|
|
|
647
728
|
`Column(props)`
|
|
@@ -10,13 +10,7 @@ jsonld:
|
|
|
10
10
|
|
|
11
11
|
# Reference
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
and their options.
|
|
15
|
-
- **[Configuration](./configuration/)** — every field of
|
|
16
|
-
`docpensieve.config.mjs`, its default value and its effect.
|
|
17
|
-
- **[Frontmatter](./frontmatter/)** — the fields recognised at the top
|
|
18
|
-
of a page.
|
|
19
|
-
- **[Theme](./theme/)** — slots, tokens and styling options.
|
|
13
|
+
<Cards />
|
|
20
14
|
|
|
21
15
|
To learn how to use them rather than look them up, the [guide](../guide/) is the
|
|
22
16
|
right starting point.
|
package/starter/05-whats-new.md
CHANGED
|
@@ -1,80 +1,40 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: What's new in 0.
|
|
3
|
-
description: What the 0.
|
|
2
|
+
title: What's new in 0.3
|
|
3
|
+
description: What the 0.3 brings, and what it changes for a 0.2 project.
|
|
4
4
|
tags: [release]
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
# What's new in 0.
|
|
7
|
+
# What's new in 0.3
|
|
8
8
|
|
|
9
|
-
This version is **
|
|
10
|
-
|
|
9
|
+
This version is **in preparation**. Its betas go out under the npm tag `beta`,
|
|
10
|
+
while the version installed by default stays the 0.2, documented in the
|
|
11
|
+
`latest` pages of this site:
|
|
11
12
|
|
|
12
13
|
```bash
|
|
13
|
-
|
|
14
|
+
npx docpensieve@beta init my-site
|
|
14
15
|
```
|
|
15
16
|
|
|
16
|
-
What follows describes everything it brings, and
|
|
17
|
-
[Migrate from 0.1 to 0.2](./guide/migrate-from-0-1/) says what to check in a
|
|
18
|
-
0.1 project.
|
|
19
|
-
|
|
20
17
|
## Already there
|
|
21
18
|
|
|
22
|
-
###
|
|
23
|
-
|
|
24
|
-
`sidebar: 'sidebar.json'` replaces the menu derived from the file tree with
|
|
25
|
-
one you describe — pages in the order you want, categories, links outside the
|
|
26
|
-
site. Each version reads its own file, since each has its own pages. A section
|
|
27
|
-
can keep its automatic menu with a single entry, which is how the DocPensieve
|
|
28
|
-
section stays whole without listing its pages.
|
|
29
|
-
|
|
30
|
-
See [Writing the menu by hand](./guide/writing-pages/) in the guide, and the
|
|
31
|
-
[`sidebar` field](./reference/configuration/) in the reference.
|
|
32
|
-
|
|
33
|
-
### Search engines and feed readers
|
|
34
|
-
|
|
35
|
-
With `siteUrl` set, the build writes `sitemap.xml` for search engines — and
|
|
36
|
-
`robots.txt` when the site sits at the root of its domain. `feed: true` adds an
|
|
37
|
-
RSS feed of the dated pages. See [Sitemap and feed](./reference/configuration/)
|
|
38
|
-
in the reference.
|
|
39
|
-
|
|
40
|
-
### Search
|
|
41
|
-
|
|
42
|
-
A search field in the header, and a search page in each version. The index is
|
|
43
|
-
built with the site, and the field is a plain form: only the search page loads
|
|
44
|
-
a script of its own, and without it the page stays the list of every page. See
|
|
45
|
-
[Search](./reference/configuration/) in the reference.
|
|
46
|
-
|
|
47
|
-
### A colour scheme of your choosing, and a logo per version
|
|
48
|
-
|
|
49
|
-
`theme.darkMode: 'dark'` keeps the site dark whatever the reader's system —
|
|
50
|
-
`'light'` keeps it light; `'class'`, the default, still follows the system.
|
|
51
|
-
Until now the field was accepted and did nothing. A version can also carry its
|
|
52
|
-
own `logo` and `favicon`, to tell a beta apart at a glance. See the
|
|
53
|
-
[configuration reference](./reference/configuration/).
|
|
54
|
-
|
|
55
|
-
### A light / dark switch
|
|
56
|
-
|
|
57
|
-
A button in the header switches between light and dark, and remembers the
|
|
58
|
-
choice from page to page. It is on by default — a few lines of inline script
|
|
59
|
-
in every page; `theme.toggle: false` removes it, and pages then load no script.
|
|
60
|
-
|
|
61
|
-
### Lighter pages
|
|
19
|
+
### Authors at the head of a page
|
|
62
20
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
21
|
+
A page carrying `authors`, `date` or `modified` now opens with a byline: who
|
|
22
|
+
wrote it, and when. The names show as written; a JSON file of the version,
|
|
23
|
+
named by `authors: 'authors.json'`, adds a biography, an avatar and a link —
|
|
24
|
+
and feeds the page data with them. See
|
|
25
|
+
[Who wrote the page](./guide/writing-pages/) in the guide, and the
|
|
26
|
+
[`authors` field](./reference/configuration/) in the reference.
|
|
67
27
|
|
|
68
|
-
###
|
|
28
|
+
### Series and cards
|
|
69
29
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
30
|
+
A folder is a series: its `index` page introduces it, and the pages beside
|
|
31
|
+
that index are its instalments. The `Cards` component turns that structure
|
|
32
|
+
into a grid of clickable cards — title, description, image, number of pages,
|
|
33
|
+
update date — instead of an index list written by hand, which goes stale at
|
|
34
|
+
the first page renamed. See [Cards](./components/cards/).
|
|
74
35
|
|
|
75
|
-
## For a 0.
|
|
36
|
+
## For a 0.2 project
|
|
76
37
|
|
|
77
|
-
Nothing to change: a 0.
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
on its own, what to check, and what is worth turning on.
|
|
38
|
+
Nothing to change: a 0.2 configuration builds as it is.
|
|
39
|
+
[Migrate from latest to beta](./guide/migrate-to-beta/) lists what changes on
|
|
40
|
+
its own, what to check, and what is worth turning on.
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Migrate from 0.1 to 0.2
|
|
3
|
-
description: Move a project from the 0.1 to the 0.2 — what changes on its own, what to check, what to turn on.
|
|
4
|
-
tags: [guide, migration]
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Migrate from 0.1 to 0.2
|
|
8
|
-
|
|
9
|
-
A project on the 0.1 builds with the 0.2 as it is: every new field is
|
|
10
|
-
optional. A few things change on their own, though, and deserve a look.
|
|
11
|
-
|
|
12
|
-
## Update
|
|
13
|
-
|
|
14
|
-
```bash
|
|
15
|
-
npm install docpensieve@latest
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
Through `npx` alone, `npx docpensieve` fetches the 0.2 by itself. Going back
|
|
19
|
-
is `npm install docpensieve@0.1.5`.
|
|
20
|
-
|
|
21
|
-
## What changes on its own
|
|
22
|
-
|
|
23
|
-
| What | In 0.2 |
|
|
24
|
-
| ------------------- | ----------------------------------------------------------------------------------- |
|
|
25
|
-
| Search | A field in the header, and a page at `/search/` in each version |
|
|
26
|
-
| `sitemap.xml` | Written at the root of the site as soon as `siteUrl` is set |
|
|
27
|
-
| `robots.txt` | Written with it, when the site is served at the root of its domain |
|
|
28
|
-
| The stylesheet | Minified |
|
|
29
|
-
| Images | Their width and height are written; all but the first of a page load lazily |
|
|
30
|
-
| Light / dark switch | A button in the header, remembered from page to page — a few lines of inline script |
|
|
31
|
-
| `theme.darkMode` | Now read: `'dark'` and `'light'` keep one scheme, `'class'` follows the system |
|
|
32
|
-
|
|
33
|
-
Every page now carries the few lines of the light / dark switch —
|
|
34
|
-
`theme.toggle: false` removes them — and the search page loads its own script.
|
|
35
|
-
|
|
36
|
-
## What to check
|
|
37
|
-
|
|
38
|
-
- **A page of yours at `/search/`** now stops the build: that address is the
|
|
39
|
-
search page's. Rename your page, or set `search: false`.
|
|
40
|
-
- **`theme.darkMode`** was accepted and ignored in 0.1. A value other than
|
|
41
|
-
`'class'` now takes effect — and an unknown one stops the build.
|
|
42
|
-
- **The light / dark switch** is on by default. `theme.toggle: false` removes
|
|
43
|
-
it, and with it the only script content pages carry.
|
|
44
|
-
- **Your own `robots.txt`**, if you published one next to the site, is now
|
|
45
|
-
written by the build when the site sits at the root of its domain. Set
|
|
46
|
-
`sitemap: false` to keep yours.
|
|
47
|
-
|
|
48
|
-
## What to turn on
|
|
49
|
-
|
|
50
|
-
| Field | Gives |
|
|
51
|
-
| ---------------------------- | ------------------------------------------------------------- |
|
|
52
|
-
| `sidebar: 'sidebar.json'` | A menu written by hand, in each version's folder |
|
|
53
|
-
| `feed: true` | An RSS feed of the pages that carry a `date` |
|
|
54
|
-
| `versions[].logo`, `favicon` | A logo and a favicon of the version's own — a beta told apart |
|
|
55
|
-
| `search: false` | No search at all, if the site does not need one |
|
|
56
|
-
|
|
57
|
-
Every field is in the [configuration reference](../reference/configuration/).
|