Skip to content

Commit 0982521

Browse files
committed
recommend head over scripts
1 parent 8516a14 commit 0982521

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

docs/config.md

+11-1
Original file line numberDiff line numberDiff line change
@@ -164,14 +164,24 @@ An HTML fragment to add to the footer. Defaults to “Built with Observable.”
164164

165165
## scripts
166166

167-
Additional scripts to add to the head, such as for analytics. Unlike the **head** option, this allows you to reference a local script in the source root.
167+
Additional scripts to add to the head, such as for analytics. For example, this:
168168

169169
```js run=false
170170
export default {
171171
scripts: [{type: "module", async: true, src: "analytics.js"}]
172172
};
173173
```
174174

175+
Is equivalent to setting the **head** option:
176+
177+
```js run=false
178+
export default {
179+
head: `<script type="module" async src="analytics.js"></script>`
180+
};
181+
```
182+
183+
We recommend you use the **head** option instead of this option.
184+
175185
## base
176186

177187
The base path when serving the site. Currently this only affects the custom 404 page, if any.

0 commit comments

Comments
 (0)