Files
harheimertc/nuxt.config.js
Torsten Schulz (local) 7c93966878
All checks were successful
Code Analysis and Production Deploy / analyze (push) Successful in 7m44s
Code Analysis and Production Deploy / deploy-production (push) Has been skipped
Code Analysis and Production Deploy / deploy-test (push) Successful in 2m15s
feat: add robots.txt and sitemap.xml routes for SEO optimization
- Implemented a new route for robots.txt to control crawler access.
- Added a sitemap.xml route to provide search engines with a list of site URLs.
- Included functions for URL normalization and XML escaping to ensure proper formatting.
2026-05-31 13:36:49 +02:00

157 lines
5.6 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
devtools: { enabled: process.env.NODE_ENV !== 'production' },
modules: ['@nuxtjs/tailwindcss', '@pinia/nuxt'],
nitro: {
preset: 'node-server',
dev: process.env.NODE_ENV !== 'production',
sourceMap: false
},
vite: {
build: {
reportCompressedSize: false
}
},
// Erzwinge Dev-Port und Host zuverlässig für `npm run dev`
devServer: {
port: 3100,
host: '0.0.0.0'
},
runtimeConfig: {
// Private keys (only available on server-side)
jwtSecret: process.env.JWT_SECRET || 'local_development_secret_key_change_in_production',
encryptionKey: process.env.ENCRYPTION_KEY || 'local_development_encryption_key_change_in_production',
smtpHost: process.env.SMTP_HOST || 'smtp.gmail.com',
smtpPort: process.env.SMTP_PORT || 587,
smtpUser: process.env.SMTP_USER || 'tsschulz@tsschulz.de',
smtpPass: process.env.SMTP_PASS || '',
// Public keys (exposed to client-side)
public: {
baseUrl: process.env.NUXT_PUBLIC_BASE_URL || 'http://localhost:3100',
nodeEnv: process.env.NODE_ENV || 'development'
}
},
app: {
head: {
title: 'Harheimer Tischtennis-Club 1954 e.V. - Offizielle Website',
htmlAttrs: {
lang: 'de'
},
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ 'http-equiv': 'X-UA-Compatible', content: 'IE=edge' },
{
name: 'description',
content: 'Offizielle Website des Harheimer Tischtennis-Club 1954 e.V. - Informationen zu Mannschaften, Terminen, Training und Mitgliedschaft.'
},
{
name: 'keywords',
content: 'Harheimer Tischtennis-Club, Tischtennis, Verein, Mannschaften, Training, Mitgliedschaft, Frankfurt, Harheim, Tischtennisclub, Sport, Pingpong'
},
{
name: 'author',
content: 'Harheimer Tischtennis-Club 1954 e.V.'
},
{
name: 'robots',
content: 'index, follow'
},
// Open Graph / Facebook
{ property: 'og:type', content: 'website' },
{ property: 'og:url', content: 'https://www.harheimertc.de/' },
{ property: 'og:title', content: 'Harheimer Tischtennis-Club 1954 e.V.' },
{ property: 'og:description', content: 'Offizielle Website des Harheimer Tischtennis-Club 1954 e.V.' },
// Twitter
{ property: 'twitter:card', content: 'summary_large_image' },
{ property: 'twitter:url', content: 'https://www.harheimertc.de/' },
{ property: 'twitter:title', content: 'Harheimer Tischtennis-Club 1954 e.V.' },
{ property: 'twitter:description', content: 'Offizielle Website des Harheimer Tischtennis-Club 1954 e.V.' }
],
link: [
{ rel: 'canonical', href: 'https://www.harheimertc.de/' },
{
rel: 'preload',
as: 'image',
href: '/images/club_about_us_hero_960.webp',
type: 'image/webp',
media: '(max-width: 1024px)'
},
{
rel: 'preload',
as: 'image',
href: '/images/club_about_us_hero_1600.webp',
type: 'image/webp',
media: '(min-width: 1025px)'
},
{ rel: 'preconnect', href: 'https://fonts.googleapis.com' },
{ rel: 'preconnect', href: 'https://fonts.gstatic.com', crossorigin: '' },
{
rel: 'stylesheet',
href: 'https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Montserrat:wght@700;800;900&display=swap'
}
]
}
},
css: ['~/assets/css/main.css'],
compatibilityDate: '2024-04-03',
hooks: {
'build:before': async () => {
const fs = await import('fs/promises')
const path = await import('path')
// Erstelle uploads Verzeichnis im public Ordner
const uploadsDir = path.join(process.cwd(), '.output', 'public', 'uploads')
try {
await fs.mkdir(uploadsDir, { recursive: true })
console.log('✅ Uploads-Verzeichnis erstellt:', uploadsDir)
} catch (error) {
console.log(' Uploads-Verzeichnis bereits vorhanden oder Fehler:', error.message)
}
// Erstelle temp Verzeichnis für LaTeX-Kompilierung
const tempDir = path.join(process.cwd(), '.output', 'temp')
try {
await fs.mkdir(tempDir, { recursive: true })
console.log('✅ Temp-Verzeichnis erstellt:', tempDir)
} catch (error) {
console.log(' Temp-Verzeichnis bereits vorhanden oder Fehler:', error.message)
}
},
'build:after': async () => {
const fs = await import('fs/promises')
const path = await import('path')
// Erstelle uploads Verzeichnis im public Ordner (nach dem Build)
const uploadsDir = path.join(process.cwd(), '.output', 'public', 'uploads')
try {
await fs.mkdir(uploadsDir, { recursive: true })
console.log('✅ Uploads-Verzeichnis nach Build erstellt:', uploadsDir)
} catch (error) {
console.log(' Uploads-Verzeichnis bereits vorhanden oder Fehler:', error.message)
}
// Erstelle temp Verzeichnis für LaTeX-Kompilierung (nach dem Build)
const tempDir = path.join(process.cwd(), '.output', 'temp')
try {
await fs.mkdir(tempDir, { recursive: true })
console.log('✅ Temp-Verzeichnis nach Build erstellt:', tempDir)
} catch (error) {
console.log(' Temp-Verzeichnis bereits vorhanden oder Fehler:', error.message)
}
}
}
})