From 45850cbd702a8f92dea5bfa0468003bd20ab6f1e Mon Sep 17 00:00:00 2001 From: Liran Tal Date: Tue, 11 Oct 2022 11:18:35 +0000 Subject: [PATCH 1/5] feat: add out of the box support for Splitbee Analytics --- src/components/core/MetaTags.astro | 3 +++ src/components/core/SplitbeeAnalytics.astro | 6 ++++++ src/config.mjs | 6 ++++++ 3 files changed, 15 insertions(+) create mode 100644 src/components/core/SplitbeeAnalytics.astro diff --git a/src/components/core/MetaTags.astro b/src/components/core/MetaTags.astro index f382b29..596427b 100644 --- a/src/components/core/MetaTags.astro +++ b/src/components/core/MetaTags.astro @@ -9,6 +9,7 @@ import defaultImageSrc from '~/assets/images/default.png'; import { SITE } from '~/config.mjs'; import Fonts from '../atoms/Fonts.astro'; import ExtraMetaTags from '../atoms/ExtraMetaTags.astro'; +import SplitbeeAnalytics from "./SplitbeeAnalytics.astro"; const { src: defaultImage } = await getImage({ src: defaultImageSrc, @@ -76,4 +77,6 @@ const image = {SITE.googleAnalyticsId && } +{SITE.splitbeeAnalytics?.enabled && } + diff --git a/src/components/core/SplitbeeAnalytics.astro b/src/components/core/SplitbeeAnalytics.astro new file mode 100644 index 0000000..9f2da53 --- /dev/null +++ b/src/components/core/SplitbeeAnalytics.astro @@ -0,0 +1,6 @@ + + diff --git a/src/config.mjs b/src/config.mjs index 7d9852f..2845c42 100644 --- a/src/config.mjs +++ b/src/config.mjs @@ -9,6 +9,12 @@ export const SITE = { googleAnalyticsId: false, // or "G-XXXXXXXXXX", googleSiteVerificationId: 'orcPxI47GSa-cRvY11tUe6iGg2IO_RPvnA1q95iEM3M', + + splitbeeAnalytics: { + enabled: false, + doNotTrack: true, + noCookieMode: false, + } }; export const BLOG = { From be2a6e171c81f39803e67b6cc363151ba7b43543 Mon Sep 17 00:00:00 2001 From: widgeter <106940567+widgeter@users.noreply.github.com> Date: Sat, 22 Oct 2022 09:47:45 +0200 Subject: [PATCH 2/5] Update SplitbeeAnalytics.astro --- src/components/core/SplitbeeAnalytics.astro | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/components/core/SplitbeeAnalytics.astro b/src/components/core/SplitbeeAnalytics.astro index 9f2da53..9e094dd 100644 --- a/src/components/core/SplitbeeAnalytics.astro +++ b/src/components/core/SplitbeeAnalytics.astro @@ -1,6 +1,15 @@ +--- +const { + doNotTrack = true, + noCookieMode = false, + url = "https://cdn.splitbee.io/sb.js" +} = Astro.props; +--- + + data-respect-dnt={doNotTrack} + data-no-cookie={noCookieMode} + async + src={url} +> From 54d2689286c46c9368e3c73bb482c96710cd93e3 Mon Sep 17 00:00:00 2001 From: widgeter <106940567+widgeter@users.noreply.github.com> Date: Sat, 22 Oct 2022 09:48:43 +0200 Subject: [PATCH 3/5] Update config.mjs --- src/config.mjs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/config.mjs b/src/config.mjs index 2845c42..7d9852f 100644 --- a/src/config.mjs +++ b/src/config.mjs @@ -9,12 +9,6 @@ export const SITE = { googleAnalyticsId: false, // or "G-XXXXXXXXXX", googleSiteVerificationId: 'orcPxI47GSa-cRvY11tUe6iGg2IO_RPvnA1q95iEM3M', - - splitbeeAnalytics: { - enabled: false, - doNotTrack: true, - noCookieMode: false, - } }; export const BLOG = { From 7c4bdeb853422ed7f4c6ac8c1483ddfac7373fa8 Mon Sep 17 00:00:00 2001 From: Liran Tal Date: Sat, 22 Oct 2022 11:32:21 +0300 Subject: [PATCH 4/5] docs: update analytics support and completed tasks This PR updates the README to add information: --- README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index a57e2b3..f09e464 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ - ✅ Integration with **Tailwind CSS** ([@astrojs/tailwind](https://docs.astro.build/en/guides/integrations-guide/tailwind/)). - ✅ Supports **Dark mode**. - ✅ **Fast and SEO friendly blog** with automatic **RSS feed** ([@astrojs/rss](https://docs.astro.build/en/guides/rss/)) and [**MDX** support](https://docs.astro.build/en/guides/integrations-guide/mdx/). +- ✅ **Analytics** built-in Google Analytics, and Splitbee integration. - ✅ **Image optimization** ([@astrojs/images](https://docs.astro.build/en/guides/integrations-guide/image/)). - ✅ Generation of **project sitemap** based on your routes ([@astrojs/sitemap](https://docs.astro.build/en/guides/integrations-guide/sitemap/)). - ✅ **Open Graph tags** for social media sharing @@ -204,16 +205,16 @@ Clone this repository on own GitHub account and deploy to Vercel: ## Roadmap - *Project*: - - **(DONE)** Reduce the complexity in the components folder and simplify the other folders to make it very easy to use. + - ✅ Reduce the complexity in the components folder and simplify the other folders to make it very easy to use. - Create simple and clear strategy to get template updates - Move specific configurations to a specialized file - Fix some bugs with prettier - Make the use of images clean and intuitive - *SEO*: - - **(DONE)** Add support to easily manage SEO meta-tags (title, description, canonical, social sharing, ...) + - ✅ Add support to easily manage SEO meta-tags (title, description, canonical, social sharing, ...) - *Blog*: - - **(DONE)** Support to Fast and SEO friendly blog - - **(DONE)** Add support for categories and tags. + - ✅ Support to Fast and SEO friendly blog + - ✅ Add support for categories and tags. - Improve blog design - Create component or utilities for latest posts - Create component or utilities for related posts From f3f29289723139b5b971769446fb4de44baff560 Mon Sep 17 00:00:00 2001 From: prototypa <54446028+prototypa@users.noreply.github.com> Date: Mon, 31 Oct 2022 14:10:35 +0100 Subject: [PATCH 5/5] Update README.md --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f09e464..2acef19 100644 --- a/README.md +++ b/README.md @@ -8,14 +8,13 @@ ## Features - ✅ Integration with **Tailwind CSS** ([@astrojs/tailwind](https://docs.astro.build/en/guides/integrations-guide/tailwind/)). -- ✅ Supports **Dark mode**. +- ✅ **Production-ready** scores in [Lighthouse](https://web.dev/measure/) and [PageSpeed Insights](https://pagespeed.web.dev/) reports - ✅ **Fast and SEO friendly blog** with automatic **RSS feed** ([@astrojs/rss](https://docs.astro.build/en/guides/rss/)) and [**MDX** support](https://docs.astro.build/en/guides/integrations-guide/mdx/). +- ✅ Supports **Dark mode**. - ✅ **Analytics** built-in Google Analytics, and Splitbee integration. - ✅ **Image optimization** ([@astrojs/images](https://docs.astro.build/en/guides/integrations-guide/image/)). - ✅ Generation of **project sitemap** based on your routes ([@astrojs/sitemap](https://docs.astro.build/en/guides/integrations-guide/sitemap/)). - ✅ **Open Graph tags** for social media sharing -- ✅ **Fonts optimization** at build time ([subfont](https://www.npmjs.com/package/subfont)). -- ✅ **Production-ready** scores in [Lighthouse](https://web.dev/measure/) and [PageSpeed Insights](https://pagespeed.web.dev/) reports