Skip to content

Commit

Permalink
recommend head over scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
mbostock committed Apr 26, 2024
1 parent 8516a14 commit 0982521
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,14 +164,24 @@ An HTML fragment to add to the footer. Defaults to “Built with Observable.”

## scripts

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.
Additional scripts to add to the head, such as for analytics. For example, this:

```js run=false
export default {
scripts: [{type: "module", async: true, src: "analytics.js"}]
};
```

Is equivalent to setting the **head** option:

```js run=false
export default {
head: `<script type="module" async src="analytics.js"></script>`
};
```

We recommend you use the **head** option instead of this option.

## base

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

0 comments on commit 0982521

Please sign in to comment.