Skip to content

Commit

Permalink
docs: add tracking script to docs site
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewWid committed Oct 27, 2024
1 parent 8a44ce0 commit e0661f9
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/.env.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
PUBLIC_ANALYTICS_SCRIPT_URL=
PUBLIC_ANALYTICS_WEBSITE_ID=
1 change: 1 addition & 0 deletions docs/src/content/docs/guides/batching.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
layout: ../../../layouts/Base.astro
title: Batching with event buffers
description: Learn how to batch and send multiple events at a time with event buffers.
sidebar:
Expand Down
1 change: 1 addition & 0 deletions docs/src/content/docs/guides/channels.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
layout: ../../../layouts/Base.astro
title: Broadcasting with channels
description: Learn how to use channels which allow you to broadcast events to many clients at once.
sidebar:
Expand Down
1 change: 1 addition & 0 deletions docs/src/content/docs/guides/getting-started.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
layout: ../../../layouts/Base.astro
title: Getting started
description: Get started using Better SSE.
sidebar:
Expand Down
1 change: 1 addition & 0 deletions docs/src/content/docs/reference/api.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
layout: ../../../layouts/Base.astro
title: API Reference
description: API reference for each Better SSE package export.
sidebar:
Expand Down
1 change: 1 addition & 0 deletions docs/src/content/docs/reference/comparison.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
layout: ../../../layouts/Base.astro
title: Comparison with other tools
description: Compare the features of Better SSE with other similar Node SSE libraries.
sidebar:
Expand Down
1 change: 1 addition & 0 deletions docs/src/content/docs/reference/recipes.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
layout: ../../../layouts/Base.astro
title: Usage recipes
description: See examples of using Better SSE with various Node HTTP frameworks.
sidebar:
Expand Down
14 changes: 14 additions & 0 deletions docs/src/layouts/Base.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
const ANALYTICS_SCRIPT_URL = import.meta.env.PUBLIC_ANALYTICS_SCRIPT_URL;
const ANALYTICS_WEBSITE_ID = import.meta.env.PUBLIC_ANALYTICS_WEBSITE_ID;
---
{
ANALYTICS_SCRIPT_URL && ANALYTICS_WEBSITE_ID && (
<script
defer
src={ANALYTICS_SCRIPT_URL}
data-website-id={ANALYTICS_WEBSITE_ID}
/>
)
}
<slot />

0 comments on commit e0661f9

Please sign in to comment.