Files
harheimertc/nuxt.config.js
Torsten Schulz (local) 6983186caf
Some checks failed
Code Analysis and Production Deploy / analyze (push) Failing after 5m44s
Code Analysis and Production Deploy / deploy-production (push) Has been skipped
Code Analysis and Production Deploy / deploy-test (push) Has been skipped
feat: add hero image processing and API for serving variants
- Introduced a new script `prepare-hero-variants.mjs` to generate responsive hero image variants in WebP format.
- Added a fallback image `hero_fallback.png` for each variant.
- Created an API endpoint `hero-images.get.js` to retrieve available hero image variants and their fallback images.
- Implemented directory and file checks to ensure the existence of required images before serving.
2026-05-31 14:07:14 +02:00

143 lines
5.2 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: '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)
}
}
}
})