feat: update website-creator to static mode with ConsentOS + tracking scripts

- Remove Astro DB (no longer needed for consent logging)
- Change from SSR to static output mode
- Add TrackingScripts.astro with GA4, GTM, Umami, Clarity, FB Pixel, Google Ads, TikTok, LINE
- Use ConsentOS consent-loader.js for auto-blocking tracking scripts
- Update Dockerfile to nginx static hosting
- Remove old consent template (custom consent no longer needed)
- Update SKILL.md, AGENTS.md, README.md documentation
- Add nginx.conf for static hosting
This commit is contained in:
2026-04-21 21:19:32 +07:00
parent d1edc9cd6c
commit c38cc4ae26
19 changed files with 378 additions and 1099 deletions

View File

@@ -36,8 +36,7 @@ Creates:
- Astro 6.1.7 framework
- Tailwind CSS 4.x
- Tina CMS (self-hosted)
- Astro DB for consent logging
- PDPA-compliant consent system
- External consent system integration
EOF
}
@@ -105,26 +104,6 @@ copy_template() {
log_success "Template copied"
}
copy_consent_system() {
log_info "Adding PDPA consent system..."
local consent_template="$SKILL_DIR/templates/consent"
if [ -d "$consent_template" ]; then
mkdir -p "$PROJECT_PATH/src/components/consent"
cp "$consent_template/ConsentBanner.astro" "$PROJECT_PATH/src/components/consent/" 2>/dev/null || true
cp "$consent_template/stores/"* "$PROJECT_PATH/src/stores/" 2>/dev/null || true
mkdir -p "$PROJECT_PATH/src/pages/api"
cp "$consent_template/api/consent.ts" "$PROJECT_PATH/src/pages/api/" 2>/dev/null || true
mkdir -p "$PROJECT_PATH/db"
cp "$consent_template/db/config.ts" "$PROJECT_PATH/db/" 2>/dev/null || true
fi
log_success "Consent system added"
}
copy_legal_templates() {
log_info "Copying PDPA legal templates..."
@@ -163,6 +142,9 @@ setup_environment() {
cat > .env << 'EOF'
PUBLIC_SITE_URL=http://localhost:4321
TINA_TOKEN=your-tina-token
TINA_CLIENT_ID=your-client-id
PUBLIC_CONSENT_SITE_ID=your-consent-site-id
PUBLIC_CONSENT_API_BASE=https://consent.moreminimore.com
EOF
log_success "Created default .env"
fi
@@ -203,7 +185,6 @@ main() {
check_requirements
setup_directory
copy_template
copy_consent_system
copy_legal_templates
install_dependencies
setup_environment