File tree Expand file tree Collapse file tree 2 files changed +11
-6
lines changed
Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,14 @@ copy_custom_files() {
2121 chown -R www-data:www-data /var/www/html/wp-content/themes/nextjs-headless
2222 fi
2323
24+ # Create robots.txt to block all crawlers (Next.js is the public site)
25+ echo " Creating robots.txt..."
26+ cat > /var/www/html/robots.txt << 'EOF '
27+ User-agent: *
28+ Disallow: /
29+ EOF
30+ chown www-data:www-data /var/www/html/robots.txt
31+
2432 # Run the setup script
2533 /usr/local/bin/setup-wordpress.sh
2634}
Original file line number Diff line number Diff line change @@ -34,12 +34,9 @@ if ! wp plugin is-active next-revalidate --allow-root 2>/dev/null; then
3434 wp plugin activate next-revalidate --allow-root
3535fi
3636
37- # Activate the headless theme
38- current_theme=$( wp theme list --status=active --field=name --allow-root 2> /dev/null)
39- if [ " $current_theme " != " nextjs-headless" ]; then
40- echo " Activating Next.js Headless theme..."
41- wp theme activate nextjs-headless --allow-root
42- fi
37+ # Activate the headless theme (always run, safe if already active)
38+ echo " Activating Next.js Headless theme..."
39+ wp theme activate nextjs-headless --allow-root || true
4340
4441# Configure the plugin if NEXTJS_URL is set
4542if [ -n " $NEXTJS_URL " ]; then
You can’t perform that action at this time.
0 commit comments