Conversation
There was a problem hiding this comment.
Pull request overview
Adds Plausible analytics to the Quarto documentation site by injecting an additional header include that loads the Plausible script.
Changes:
- Added
docs/include-in-header.htmlto load Plausible analytics in the document<head>. - Updated Quarto site config to include the new header file on all HTML pages.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| docs/include-in-header.html | New header include containing Plausible script tags and initialization snippet. |
| docs/_quarto.yml | Registers the new header include file via format.html.include-in-header. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <script> | ||
| window.plausible=window.plausible||function(){(plausible.q=plausible.q||[]).push(arguments)},plausible.init=plausible.init||function(i){plausible.o=i||{}}; | ||
| plausible.init() | ||
| </script> |
There was a problem hiding this comment.
The inline snippet defines plausible.init and then calls plausible.init() with no arguments, which only sets plausible.o to an empty object. If no runtime configuration is intended, this extra inline script is unnecessary (and adds an inline-JS requirement). If configuration is intended, pass explicit options and ensure initialization happens in a way that actually affects the loaded Plausible script (e.g., don’t call init as a no-op).
| <script> | |
| window.plausible=window.plausible||function(){(plausible.q=plausible.q||[]).push(arguments)},plausible.init=plausible.init||function(i){plausible.o=i||{}}; | |
| plausible.init() | |
| </script> |
Add the Plausible script in necessary to enable tracking. Tested with
docs preview.