You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The base path when serving the site. Currently this only affects the custom 404 page, if any.
199
199
200
-
## cleanUrls <ahref="https://github.com/observablehq/framework/releases/tag/v1.3.0"class="observablehq-version-badge"data-version="^1.3.0"title="Added in 1.3.0"></a>
200
+
## preserveIndex <ahref="https://github.com/observablehq/framework/pulls/1784"class="observablehq-version-badge"data-version="prerelease"title="Added in #1784"></a>
201
201
202
-
Whether page links should be “clean”, _i.e._, formatted without a `.html` extension. Defaults to true. If true, a link to `config.html` will be formatted as `config`. Regardless of this setting, a link to an index page will drop the implied `index.html`; for example `foo/index.html` will be formatted as `foo/`.
202
+
Whether page links should preserve `/index` for directories. Defaults to false. If true, a link to `/` will be formatted as `/index` if the **preserveExtension** option is false or `/index.html` if the **preserveExtension** option is true.
203
+
204
+
## preserveExtension <ahref="https://github.com/observablehq/framework/pulls/1784"class="observablehq-version-badge"data-version="prerelease"title="Added in #1784"></a>
205
+
206
+
Whether page links should preserve the `.html` extension. Defaults to false. If true, a link to `/foo` will be formatted as `/foo.html`.
Copy file name to clipboardExpand all lines: docs/getting-started.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -535,7 +535,7 @@ The <code>build</code> command generates the `dist` directory; you can then copy
535
535
536
536
<predata-copy>npx http-server dist</pre>
537
537
538
-
<divclass="tip">By default, Framework generates “clean” URLs by dropping the `.html` extension from page links. Not all webhosts support this; some need the <ahref="./config#clean-urls"><b>cleanUrls</b> config option</a> set to false.</div>
538
+
<divclass="tip">By default, Framework generates “clean” URLs by dropping the `.html` extension from page links. Not all webhosts support this; some need the <ahref="./config#preserve-extension"><b>preserveExtension</b> config option</a> set to true.</div>
539
539
540
540
<divclass="tip">When deploying to GitHub Pages without using GitHub’s related actions (<ahref="https://github.com/actions/configure-pages">configure-pages</a>,
541
541
<ahref="https://github.com/actions/deploy-pages">deploy-pages</a>, and
console.warn(`${yellow("Warning:")} the ${bold("cleanUrls")} option is deprecated; use ${bold("preserveIndex")} and ${bold("preserveExtension")} instead.`);// prettier-ignore
0 commit comments