import { createRouter, createWebHistory } from 'vue-router'; import ChatView from '../views/ChatView.vue'; import PartnersView from '../views/PartnersView.vue'; import MockupView from '../views/MockupView.vue'; import FeedbackView from '../views/FeedbackView.vue'; import FaqView from '../views/FaqView.vue'; import RulesView from '../views/RulesView.vue'; import SafetyView from '../views/SafetyView.vue'; import GuideHubView from '../views/GuideHubView.vue'; import GuideFirstMessageView from '../views/GuideFirstMessageView.vue'; import GuideProfileView from '../views/GuideProfileView.vue'; import GuideSafetyView from '../views/GuideSafetyView.vue'; import GuideRedFlagsView from '../views/GuideRedFlagsView.vue'; const SITE_URL = 'https://www.ypchat.net'; const DEFAULT_IMAGE = `${SITE_URL}/static/favicon.png`; const SUPPORTED_LOCALES = ['de', 'en', 'fr', 'es', 'it', 'ja', 'zh', 'th', 'tl']; const LOCALIZED_HOME_META = { de: { title: 'SingleChat: Kostenloser Single Chat, privat & anonym', description: 'Kostenloser Single Chat für private und anonyme Gespräche. Lerne neue Kontakte kennen und teile Bilder sicher online.', keywords: 'single chat, kostenloser chat, privat chatten, anonym chat, free chat, private chat, anonymous chat, online chat' }, en: { title: 'SingleChat: Free Private & Anonymous Single Chat', description: 'Free single chat for private and anonymous conversations. Meet new people and share images safely online.', keywords: 'single chat, free chat, private chat, anonymous chat, online chat, meet singles' }, fr: { title: 'SingleChat: Chat célibataire gratuit, privé et anonyme', description: 'Chat célibataire gratuit pour des conversations privées et anonymes. Rencontrez de nouvelles personnes en toute sécurité.', keywords: 'chat célibataire, chat gratuit, chat privé, chat anonyme, rencontre en ligne' }, es: { title: 'SingleChat: Chat gratis, privado y anónimo', description: 'Chat gratis para solteros con conversaciones privadas y anónimas. Conoce gente nueva y comparte imágenes de forma segura.', keywords: 'chat gratis, chat privado, chat anónimo, chat para solteros, conocer gente' }, it: { title: 'SingleChat: Chat single gratis, privata e anonima', description: 'Chat single gratis per conversazioni private e anonime. Conosci nuove persone e condividi immagini in sicurezza.', keywords: 'chat single, chat gratis, chat privata, chat anonima, incontri online' }, ja: { title: 'SingleChat: 無料・匿名・プライベートのシングルチャット', description: '無料で使えるシングルチャット。匿名かつプライベートに会話でき、画像共有も安全です。', keywords: 'シングルチャット, 無料チャット, 匿名チャット, プライベートチャット, オンラインチャット' }, zh: { title: 'SingleChat:免费、私密、匿名的单身聊天', description: '免费单身聊天,支持私密和匿名交流,安全分享图片并结识新朋友。', keywords: '单身聊天, 免费聊天, 私密聊天, 匿名聊天, 在线聊天' }, th: { title: 'SingleChat: แชตคนโสดฟรี แบบส่วนตัวและไม่ระบุตัวตน', description: 'แชตคนโสดฟรี สำหรับการสนทนาแบบส่วนตัวและไม่ระบุตัวตน พบผู้คนใหม่ ๆ และแชร์รูปได้อย่างปลอดภัย', keywords: 'แชตคนโสด, แชตฟรี, แชตส่วนตัว, แชตไม่ระบุตัวตน, แชตออนไลน์' }, tl: { title: 'SingleChat: Libreng private at anonymous na single chat', description: 'Libreng single chat para sa private at anonymous na usapan. Kumilala ng bagong tao at magbahagi ng larawan nang ligtas.', keywords: 'single chat, libreng chat, private chat, anonymous chat, online chat' } }; const homeSchema = { '@context': 'https://schema.org', '@type': 'WebSite', name: 'SingleChat', url: `${SITE_URL}/`, description: 'Kostenloser Single Chat für private und anonyme Gespräche. Lerne neue Kontakte kennen und tausche Bilder sicher aus.', inLanguage: 'de-DE' }; const partnersSchema = { '@context': 'https://schema.org', '@type': 'CollectionPage', name: 'Partner - SingleChat', url: `${SITE_URL}/partners`, description: 'Partnerseiten rund um Single Chat, Community und Online-Kontakte. Entdecke weitere Angebote und hilfreiche Ressourcen.', isPartOf: { '@type': 'WebSite', name: 'SingleChat', url: `${SITE_URL}/` }, inLanguage: 'de-DE' }; const feedbackSchema = { '@context': 'https://schema.org', '@type': 'CollectionPage', name: 'Feedback - SingleChat', url: `${SITE_URL}/feedback`, description: 'Öffentliches Feedback zu SingleChat: Meinungen, Vorschläge und Erfahrungsberichte für einen besseren privaten Chat.', isPartOf: { '@type': 'WebSite', name: 'SingleChat', url: `${SITE_URL}/` }, inLanguage: 'de-DE' }; const faqSchema = { '@context': 'https://schema.org', '@type': 'FAQPage', name: 'FAQ - SingleChat', url: `${SITE_URL}/faq`, description: 'FAQ zum kostenlosen Single Chat: anonym chatten, Privatsphäre schützen, Bilder sicher teilen und Nutzer blockieren.', isPartOf: { '@type': 'WebSite', name: 'SingleChat', url: `${SITE_URL}/` }, inLanguage: 'de-DE' }; const rulesSchema = { '@context': 'https://schema.org', '@type': 'WebPage', name: 'Regeln - SingleChat', url: `${SITE_URL}/regeln`, description: 'Regeln für respektvollen, privaten und sicheren Single Chat. Hinweise zu Verhalten, Spam und verbotenen Inhalten.', isPartOf: { '@type': 'WebSite', name: 'SingleChat', url: `${SITE_URL}/` }, inLanguage: 'de-DE' }; const safetySchema = { '@context': 'https://schema.org', '@type': 'WebPage', name: 'Sicherheit - SingleChat', url: `${SITE_URL}/sicherheit`, description: 'Sicherheitsseite für privaten und anonymen Chat: Privatsphäre, Schutz vor Spam, Blockieren und Melden.', isPartOf: { '@type': 'WebSite', name: 'SingleChat', url: `${SITE_URL}/` }, inLanguage: 'de-DE' }; const guideHubSchema = { '@context': 'https://schema.org', '@type': 'CollectionPage', name: 'Ratgeber - SingleChat', url: `${SITE_URL}/ratgeber`, description: 'Ratgeber mit Tipps zu erster Nachricht, Profilgestaltung, Datenschutz und sicheren Gespraechen im Single Chat.', inLanguage: 'de-DE' }; const routes = [ { path: '/', name: 'chat', component: ChatView, meta: { title: 'SingleChat: Kostenloser Single Chat, privat & anonym', description: 'Kostenloser Single Chat für private und anonyme Gespräche. Lerne neue Kontakte kennen und teile Bilder sicher online.', keywords: 'single chat, kostenloser chat, privat chatten, anonym chat, free chat, private chat, anonymous chat, online chat', ogTitle: 'SingleChat: Kostenloser Single Chat, privat & anonym', ogDescription: 'Kostenlos chatten, privat bleiben und neue Kontakte kennenlernen - mit sicherem Bildaustausch.', ogType: 'website', image: DEFAULT_IMAGE, robots: 'index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1', schema: homeSchema } }, { path: '/partners', name: 'partners', component: PartnersView, meta: { title: 'Partner für Single Chat & Community - SingleChat', description: 'Partnerseiten rund um Single Chat, Community und Online-Kontakte. Entdecke weitere Angebote und hilfreiche Ressourcen.', keywords: 'single chat partner, chat community, kontaktseiten, single-chat links, online dating chat', ogTitle: 'Partner für Single Chat & Community - SingleChat', ogDescription: 'Befreundete Seiten und Ressourcen rund um Chat, Kontakte und Community.', ogType: 'website', image: DEFAULT_IMAGE, robots: 'index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1', schema: partnersSchema } }, { path: '/feedback', name: 'feedback', component: FeedbackView, meta: { title: 'Feedback zur Chat-Plattform - SingleChat', description: 'Öffentliches Feedback zu SingleChat: Meinungen, Vorschläge und Erfahrungsberichte für einen besseren privaten Chat.', keywords: 'chat feedback, single chat erfahrungen, rückmeldung chat, verbesserungsvorschläge', ogTitle: 'Feedback zur Chat-Plattform - SingleChat', ogDescription: 'Teile deine Erfahrungen und Verbesserungsvorschläge für SingleChat.', ogType: 'website', image: DEFAULT_IMAGE, robots: 'index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1', schema: feedbackSchema } }, { path: '/faq', name: 'faq', component: FaqView, meta: { title: 'FAQ: Kostenlos, privat und anonym chatten - SingleChat', description: 'FAQ zum kostenlosen Single Chat: anonym chatten, Privatsphäre schützen, Bilder sicher teilen und Nutzer blockieren.', keywords: 'single chat faq, kostenlos chatten, anonym chatten, privater chat, safe chat', ogTitle: 'FAQ: Kostenlos, privat und anonym chatten - SingleChat', ogDescription: 'Antworten auf Fragen zu Sicherheit, Privatsphäre und Funktionen im Single Chat.', ogType: 'website', image: DEFAULT_IMAGE, robots: 'index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1', schema: faqSchema } }, { path: '/regeln', name: 'regeln', component: RulesView, meta: { title: 'Chat-Regeln für sicheren Single Chat - SingleChat', description: 'Regeln für respektvollen, privaten und sicheren Single Chat. Hinweise zu Verhalten, Spam und verbotenen Inhalten.', keywords: 'chat regeln, single chat regeln, sicher chatten, spam vermeiden, community richtlinien', ogTitle: 'Chat-Regeln für sicheren Single Chat - SingleChat', ogDescription: 'Unsere Richtlinien für respektvolle und sichere Gespräche im Chat.', ogType: 'website', image: DEFAULT_IMAGE, robots: 'index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1', schema: rulesSchema } }, { path: '/sicherheit', name: 'sicherheit', component: SafetyView, meta: { title: 'Sicherheit & Privatsphäre im privaten Chat - SingleChat', description: 'Sicherheitsseite für privaten und anonymen Chat: Privatsphäre, Schutz vor Spam, Blockieren und Melden.', keywords: 'privatsphäre chat, anonym chat sicherheit, blockieren melden, private chat safety', ogTitle: 'Sicherheit & Privatsphäre im privaten Chat - SingleChat', ogDescription: 'So schützt du deine Daten und chattest sicher und anonym.', ogType: 'website', image: DEFAULT_IMAGE, robots: 'index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1', schema: safetySchema } }, { path: '/ratgeber', name: 'ratgeber', component: GuideHubView, meta: { title: 'Ratgeber fuer privaten Single Chat - SingleChat', description: 'Praxisnahe Ratgeberartikel zu Chat-Einstieg, Profiloptimierung, Sicherheit und Red Flags im Online-Chat.', keywords: 'chat ratgeber, single chat tipps, profil tipps, sicher chatten, online chat red flags', ogTitle: 'Ratgeber fuer privaten Single Chat - SingleChat', ogDescription: 'Hilfreiche Leitfaeden fuer bessere Gespraeche und mehr Sicherheit im Chat.', ogType: 'website', image: DEFAULT_IMAGE, robots: 'index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1', schema: guideHubSchema } }, { path: '/ratgeber/erste-nachricht', name: 'ratgeber-erste-nachricht', component: GuideFirstMessageView, meta: { title: 'Die erste Nachricht im Chat - Tipps & Beispiele', description: 'So gelingt die erste Nachricht im Single Chat: konkrete Beispiele, typische Fehler und einfache Vorlagen.', keywords: 'erste nachricht chat, anschreiben tipps, chat beispiele, single chat einstieg', ogTitle: 'Die erste Nachricht im Chat - Tipps & Beispiele', ogDescription: 'Konkrete Beispiele fuer einen natuerlichen und respektvollen Chat-Einstieg.', ogType: 'article', image: DEFAULT_IMAGE, robots: 'index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1', schema: null } }, { path: '/ratgeber/profil-tipps', name: 'ratgeber-profil-tipps', component: GuideProfileView, meta: { title: 'Profil verbessern fuer bessere Chats - SingleChat', description: 'Verbessere dein Chat-Profil mit klaren, ehrlichen Angaben und starte leichter passende Gespraeche.', keywords: 'profil tipps chat, online profil verbessern, single chat profil', ogTitle: 'Profil verbessern fuer bessere Chats - SingleChat', ogDescription: 'Einfache Schritte fuer ein besseres Profil und passendere Unterhaltungen.', ogType: 'article', image: DEFAULT_IMAGE, robots: 'index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1', schema: null } }, { path: '/ratgeber/sicher-chatten', name: 'ratgeber-sicher-chatten', component: GuideSafetyView, meta: { title: 'Sicher chatten und Daten schuetzen - SingleChat', description: 'Datenschutz-Tipps fuer anonymes Chatten: Welche Informationen du teilen kannst und welche nicht.', keywords: 'sicher chatten, datenschutz chat, anonym chat tipps', ogTitle: 'Sicher chatten und Daten schuetzen - SingleChat', ogDescription: 'Praktische Regeln fuer mehr Sicherheit und Privatsphaere im Online-Chat.', ogType: 'article', image: DEFAULT_IMAGE, robots: 'index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1', schema: null } }, { path: '/ratgeber/red-flags', name: 'ratgeber-red-flags', component: GuideRedFlagsView, meta: { title: 'Red Flags im Online-Chat erkennen - SingleChat', description: 'Warnzeichen bei Spam und Manipulation im Chat erkennen und richtig reagieren.', keywords: 'red flags chat, online chat sicherheit, betrug chat erkennen', ogTitle: 'Red Flags im Online-Chat erkennen - SingleChat', ogDescription: 'Fruehe Warnsignale im Chat erkennen und sich wirksam schuetzen.', ogType: 'article', image: DEFAULT_IMAGE, robots: 'index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1', schema: null } }, { path: '/mockup-redesign', name: 'mockup-redesign', component: MockupView, meta: { title: 'Design Mockup - SingleChat', description: 'Visuelle Vorschau des geplanten Design-Refreshs fuer SingleChat.', keywords: 'SingleChat, Mockup, Design, Redesign, Vorschau', ogTitle: 'Design Mockup - SingleChat', ogDescription: 'Interne Vorschau des geplanten Design-Refreshs fuer SingleChat.', ogType: 'website', image: DEFAULT_IMAGE, robots: 'noindex, nofollow, noarchive', schema: null } } ]; for (const locale of SUPPORTED_LOCALES) { const localized = LOCALIZED_HOME_META[locale] || LOCALIZED_HOME_META.de; routes.push({ path: `/${locale}`, name: `chat-${locale}`, component: ChatView, meta: { title: localized.title, description: localized.description, keywords: localized.keywords, ogTitle: localized.title, ogDescription: localized.description, ogType: 'website', image: DEFAULT_IMAGE, robots: 'index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1', schema: { '@context': 'https://schema.org', '@type': 'WebSite', name: 'SingleChat', url: `${SITE_URL}/${locale}`, description: localized.description, inLanguage: locale } } }); } const router = createRouter({ history: createWebHistory(), routes }); function updateMetaTag(name, content, attribute = 'name') { let element = document.querySelector(`meta[${attribute}="${name}"]`); if (!element) { element = document.createElement('meta'); element.setAttribute(attribute, name); document.head.appendChild(element); } element.setAttribute('content', content); } function updateLinkTag(rel, href) { let element = document.querySelector(`link[rel="${rel}"]`); if (!element) { element = document.createElement('link'); element.setAttribute('rel', rel); document.head.appendChild(element); } element.setAttribute('href', href); } function updateJsonLd(schema) { let element = document.querySelector('#seo-json-ld'); if (!element) { element = document.createElement('script'); element.id = 'seo-json-ld'; element.type = 'application/ld+json'; document.head.appendChild(element); } element.textContent = schema ? JSON.stringify(schema) : ''; } router.beforeEach((to, from, next) => { const meta = to.meta || {}; // Immer eine eindeutige kanonische URL (Home explizit mit / am Ende der Origin) const path = to.path === '' ? '/' : to.path; const pageUrl = path === '/' ? `${SITE_URL}/` : `${SITE_URL}${path}`; const title = meta.title || 'SingleChat'; const description = meta.description || ''; const keywords = meta.keywords || ''; const ogTitle = meta.ogTitle || title; const ogDescription = meta.ogDescription || description; const ogType = meta.ogType || 'website'; const image = meta.image || DEFAULT_IMAGE; const robots = meta.robots || 'index, follow'; const localeFromPath = SUPPORTED_LOCALES.includes((to.path || '').replace('/', '')) ? (to.path || '').replace('/', '') : 'de'; document.title = title; document.documentElement.setAttribute('lang', localeFromPath); updateMetaTag('description', description); updateMetaTag('keywords', keywords); updateMetaTag('robots', robots); updateMetaTag('theme-color', '#2f6f46'); updateMetaTag('og:title', ogTitle, 'property'); updateMetaTag('og:description', ogDescription, 'property'); updateMetaTag('og:type', ogType, 'property'); updateMetaTag('og:url', pageUrl, 'property'); updateMetaTag('og:image', image, 'property'); updateMetaTag('og:site_name', 'SingleChat', 'property'); updateMetaTag('og:locale', 'de_DE', 'property'); updateMetaTag('twitter:card', robots.startsWith('noindex') ? 'summary' : 'summary_large_image'); updateMetaTag('twitter:title', ogTitle); updateMetaTag('twitter:description', ogDescription); updateMetaTag('twitter:image', image); updateLinkTag('canonical', pageUrl); updateJsonLd(meta.schema || null); next(); }); export default router;