feat(update-frontend): enhance environment file handling and add Google AdSense script
All checks were successful
Deploy to production / deploy (push) Successful in 2m3s
All checks were successful
Deploy to production / deploy (push) Successful in 2m3s
- Updated the script to prioritize the root environment file for builds, falling back to the frontend environment file if necessary. - Added a Google AdSense script to the frontend HTML for improved monetization capabilities.
This commit is contained in:
@@ -32,6 +32,10 @@
|
||||
<link rel="alternate" hreflang="fr" href="%VITE_PUBLIC_BASE_URL%/?lang=fr" />
|
||||
<link rel="alternate" hreflang="x-default" href="%VITE_PUBLIC_BASE_URL%/" />
|
||||
|
||||
<!-- Google AdSense (Auto ads) -->
|
||||
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1104166651501135"
|
||||
crossorigin="anonymous"></script>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
@@ -6,6 +6,7 @@ TARGET_DIR="${1:?target dir required}"
|
||||
FRONTEND_DIR="$TARGET_DIR/frontend"
|
||||
CURRENT_LINK="/opt/yourpart"
|
||||
CURRENT_FRONTEND="$CURRENT_LINK/frontend"
|
||||
CURRENT_ROOT_ENV="$CURRENT_LINK/.env"
|
||||
|
||||
echo "=== YourPart Frontend Update ==="
|
||||
echo "Ziel: $FRONTEND_DIR"
|
||||
@@ -25,8 +26,12 @@ rm -rf node_modules/.cache/
|
||||
|
||||
TEMP_ENV="/tmp/yourpart-frontend-env-$$"
|
||||
|
||||
if [ -f "$CURRENT_FRONTEND/.env" ]; then
|
||||
echo "Nutze bestehende .env-Datei vom Live-System für Build..."
|
||||
if [ -f "$CURRENT_ROOT_ENV" ]; then
|
||||
echo "Nutze bestehende .env-Datei vom Live-System (Root) für Build..."
|
||||
cp "$CURRENT_ROOT_ENV" "$TEMP_ENV"
|
||||
cp "$TEMP_ENV" .env
|
||||
elif [ -f "$CURRENT_FRONTEND/.env" ]; then
|
||||
echo "Nutze bestehende .env-Datei vom Live-System (Frontend) für Build..."
|
||||
cp "$CURRENT_FRONTEND/.env" "$TEMP_ENV"
|
||||
cp "$TEMP_ENV" .env
|
||||
elif [ -f .env.production ]; then
|
||||
|
||||
Reference in New Issue
Block a user