feat: use NEXT_PUBLIC_SITE_URL and remove redundant preconnect

This commit is contained in:
2026-02-23 17:21:46 +01:00
parent b7d427023e
commit 95b270810b
2 changed files with 7 additions and 4 deletions

View File

@@ -3,13 +3,15 @@ FROM node:20-alpine AS builder
WORKDIR /app WORKDIR /app
# Add build arguments for Umami # Add build arguments for Umami and Site URL
ARG UMAMI_SCRIPT ARG UMAMI_SCRIPT
ARG UMAMI_ID ARG UMAMI_ID
ARG NEXT_PUBLIC_SITE_URL
# Set environment variables for the build process # Set environment variables for the build process
ENV UMAMI_SCRIPT=$UMAMI_SCRIPT ENV UMAMI_SCRIPT=$UMAMI_SCRIPT
ENV UMAMI_ID=$UMAMI_ID ENV UMAMI_ID=$UMAMI_ID
ENV NEXT_PUBLIC_SITE_URL=$NEXT_PUBLIC_SITE_URL
ENV NODE_ENV=production ENV NODE_ENV=production
# Copy package files # Copy package files

View File

@@ -2,6 +2,8 @@ import type { Metadata } from 'next';
import './globals.css'; import './globals.css';
import { Providers } from '@/components/providers/Providers'; import { Providers } from '@/components/providers/Providers';
const siteUrl = process.env.NEXT_PUBLIC_SITE_URL || 'http://localhost:3000';
export const metadata: Metadata = { export const metadata: Metadata = {
title: 'Kit - Your Creative Toolkit', title: 'Kit - Your Creative Toolkit',
description: 'A curated collection of creative and utility tools for developers and creators. Features file conversion, image editing, and color manipulation.', description: 'A curated collection of creative and utility tools for developers and creators. Features file conversion, image editing, and color manipulation.',
@@ -9,11 +11,11 @@ export const metadata: Metadata = {
authors: [{ name: 'pivoine.art' }], authors: [{ name: 'pivoine.art' }],
creator: 'pivoine.art', creator: 'pivoine.art',
publisher: 'pivoine.art', publisher: 'pivoine.art',
metadataBase: new URL('https://kit.pivoine.art'), metadataBase: new URL(siteUrl),
openGraph: { openGraph: {
title: 'Kit - Your Creative Toolkit', title: 'Kit - Your Creative Toolkit',
description: 'A curated collection of creative and utility tools for developers and creators. Privacy-first, open source, and free to use.', description: 'A curated collection of creative and utility tools for developers and creators. Privacy-first, open source, and free to use.',
url: 'https://kit.pivoine.art', url: siteUrl,
siteName: 'Kit', siteName: 'Kit',
locale: 'en_US', locale: 'en_US',
type: 'website', type: 'website',
@@ -58,7 +60,6 @@ export default function RootLayout({
<html lang="en" className="dark" suppressHydrationWarning> <html lang="en" className="dark" suppressHydrationWarning>
<head> <head>
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="preconnect" href="https://kit.pivoine.art" />
{isProd && umamiScript && umamiId && ( {isProd && umamiScript && umamiId && (
<script defer src={umamiScript} data-website-id={umamiId}></script> <script defer src={umamiScript} data-website-id={umamiId}></script>
)} )}