Skip to content

Commit 2563bca

Browse files
committed
Remove Default Value of Env Variable
1 parent ac40204 commit 2563bca

File tree

3 files changed

+4
-11
lines changed

3 files changed

+4
-11
lines changed

.github/workflows/nextjs.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,6 @@ jobs:
7373
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-
7474
- name: Install dependencies
7575
run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }}
76-
- name: Check Environment Variables
77-
run: |
78-
echo "App URL : $APP_URL"
79-
echo "Google Analytics Id : $NEXT_PUBLIC_MEASUREMENT_ID"
80-
env:
81-
APP_URL: ${{ vars.APP_URL }}
82-
NEXT_PUBLIC_MEASUREMENT_ID: ${{ vars.NEXT_PUBLIC_MEASUREMENT_ID }}
8376
- name: Build with Next.js
8477
env:
8578
APP_URL: ${{ vars.APP_URL }}

src/app/layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export const metadata: Metadata = {
1010
title: profileData.name,
1111
description: `${profileData.name}'s Portfolio`,
1212
metadataBase: new URL(
13-
`https://${process.env.APP_URL || 'dev-zha.github.io'}`
13+
process.env.APP_URL ? `https://${process.env.APP_URL}` : '/'
1414
),
1515
openGraph: {
1616
title: profileData.name,
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import React from 'react';
2-
import { GoogleAnalytics as GoogleAnalyticsFromLib } from '@next/third-parties/google';
2+
import { GoogleAnalytics as GA } from '@next/third-parties/google';
33

44
export default function GoogleAnalytics() {
5-
const measurementId = process.env.NEXT_PUBLIC_MEASUREMENT_ID || "G-DG56DWKNWN";
5+
const measurementId = process.env.NEXT_PUBLIC_MEASUREMENT_ID;
66

77
if (!measurementId) {
88
return null;
99
}
1010

11-
return <GoogleAnalyticsFromLib gaId={measurementId} />;
11+
return <GA gaId={measurementId} />;
1212
}

0 commit comments

Comments
 (0)