Skip to content

Commit 529ee37

Browse files
authored
1.6.0 (#1244)
* fix #1237; null head, header, footer * 1.6.0
1 parent a9cbbf6 commit 529ee37

File tree

7 files changed

+16
-16
lines changed

7 files changed

+16
-16
lines changed

docs/config.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ An array containing pages and sections. If not specified, it defaults to all Mar
116116

117117
Both pages and sections have a **name**, which typically corresponds to the page’s title. The name gets displayed in the sidebar. Clicking on a page navigates to the corresponding **path**, which should start with a leading slash and be relative to the root; the path can also be specified as a full URL to navigate to an external site. Each section must specify an array of **pages**.
118118

119-
Sections may be **collapsible**. <a href="https://github.com/observablehq/framework/pull/1208" class="observablehq-version-badge" data-version="prerelease" title="Added in #1208"></a> If the **open** option is set, the **collapsible** option defaults to true; otherwise it defaults to false. If the section is not collapsible, the **open** option is ignored and the section is always open; otherwise, the **open** option defaults to true. When a section is collapsible, clicking on a section header opens or closes that section. A section will always be open if the current page belongs to that section.
119+
Sections may be **collapsible**. <a href="https://github.com/observablehq/framework/releases/tag/v1.6.0" class="observablehq-version-badge" data-version="^1.6.0" title="Added in 1.6.0"></a> If the **open** option is set, the **collapsible** option defaults to true; otherwise it defaults to false. If the section is not collapsible, the **open** option is ignored and the section is always open; otherwise, the **open** option defaults to true. When a section is collapsible, clicking on a section header opens or closes that section. A section will always be open if the current page belongs to that section.
120120

121121
For example, here **pages** specifies two sections and a total of four pages:
122122

docs/getting-started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ Or with Yarn:
152152

153153
You should see something like this:
154154

155-
<pre data-copy="none"><b class="green">Observable Framework</b> v1.5.1
155+
<pre data-copy="none"><b class="green">Observable Framework</b> v1.6.0
156156
↳ <u><a href="http://127.0.0.1:3000/" style="color: inherit;">http://127.0.0.1:3000/</a></u></pre>
157157

158158
<div class="note">

docs/imports.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Downloads from npm are cached in `.observablehq/cache/_npm` within your [source
7171

7272
Self-hosting of `npm:` imports applies to transitive static and [dynamic imports](#dynamic-imports). In addition to downloading modules, Framework downloads supporting files as needed for [recommended libraries](#implicit-imports) and [`import.meta.resolve`](#import-resolutions). For example, [DuckDB](./lib/duckdb) needs WebAssembly modules, and [KaTeX](./lib/tex) needs a stylesheet and fonts. For dynamic imports and `import.meta.resolve`, Framework is only able to self-host import specifiers that are static string literals.
7373

74-
## Node imports <a href="https://github.com/observablehq/framework/pull/1156" class="observablehq-version-badge" data-version="prerelease" title="Added in #1156"></a>
74+
## Node imports <a href="https://github.com/observablehq/framework/releases/tag/v1.6.0" class="observablehq-version-badge" data-version="^1.6.0" title="Added in 1.6.0"></a>
7575

7676
You can import from `node_modules`. This is useful for managing dependencies with a package manager such as npm or Yarn, for importing private packages from the npm registry, or for importing from a different package registry such as GitHub.
7777

docs/lib/csv.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const capitals = FileAttachment("us-state-capitals.tsv").tsv({typed: true});
2828
Inputs.table(capitals)
2929
```
3030

31-
For a different delimiter, use `FileAttachment.dsv`. <a href="https://github.com/observablehq/framework/pull/1172" class="observablehq-version-badge" data-version="prerelease" title="Added in #1172"></a> For example, for semicolon separated values:
31+
For a different delimiter, use `FileAttachment.dsv`. <a href="https://github.com/observablehq/framework/releases/tag/v1.6.0" class="observablehq-version-badge" data-version="^1.6.0" title="Added in 1.6.0"></a> For example, for semicolon separated values:
3232

3333
```js run=false
3434
const capitals = FileAttachment("us-state-capitals.csv").dsv({delimiter: ";", typed: true});

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@observablehq/framework",
33
"license": "ISC",
4-
"version": "1.5.1",
4+
"version": "1.6.0",
55
"type": "module",
66
"publishConfig": {
77
"access": "public"

src/config.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ export interface Config {
4949
pages: (Page | Section<Page>)[];
5050
pager: boolean; // defaults to true
5151
scripts: Script[]; // defaults to empty array
52-
head: string; // defaults to empty string
53-
header: string; // defaults to empty string
54-
footer: string; // defaults to “Built with Observable on [date].”
52+
head: string | null; // defaults to null
53+
header: string | null; // defaults to null
54+
footer: string | null; // defaults to “Built with Observable on [date].”
5555
toc: TableOfContents;
5656
style: null | Style; // defaults to {theme: ["light", "dark"]}
5757
deploy: null | {workspace: string; project: string};
@@ -161,9 +161,9 @@ export function normalizeConfig(spec: any = {}, defaultRoot = "docs", watchPath?
161161
if (sidebar !== undefined) sidebar = Boolean(sidebar);
162162
pager = Boolean(pager);
163163
scripts = Array.from(scripts, normalizeScript);
164-
head = String(head);
165-
header = String(header);
166-
footer = String(footer);
164+
head = stringOrNull(head);
165+
header = stringOrNull(header);
166+
footer = stringOrNull(footer);
167167
toc = normalizeToc(toc);
168168
deploy = deploy ? {workspace: String(deploy.workspace).replace(/^@+/, ""), project: String(deploy.project)} : null;
169169
search = Boolean(search);
@@ -280,3 +280,7 @@ export function mergeStyle(
280280
? defaultStyle
281281
: {theme};
282282
}
283+
284+
export function stringOrNull(spec: unknown): string | null {
285+
return spec == null || spec === false ? null : String(spec);
286+
}

src/frontMatter.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import matter from "gray-matter";
2-
import {normalizeTheme} from "./config.js";
2+
import {normalizeTheme, stringOrNull} from "./config.js";
33
import {yellow} from "./tty.js";
44

55
export interface FrontMatter {
@@ -49,10 +49,6 @@ export function normalizeFrontMatter(spec: any = {}): FrontMatter {
4949
return frontMatter;
5050
}
5151

52-
function stringOrNull(spec: unknown): string | null {
53-
return spec == null || spec === false ? null : String(spec);
54-
}
55-
5652
function normalizeToc(spec: unknown): {show?: boolean; label?: string} {
5753
if (spec == null) return {show: false};
5854
if (typeof spec !== "object") return {show: Boolean(spec)};

0 commit comments

Comments
 (0)