Skip to content

Commit 3a2f544

Browse files
committed
feat(web): i18n sync, SEO/GEO improvements, IndexNow key for fxtun.dev
- getDomainLocale: recognize fxtun.dev as EN, auto-persist locale - getBlogUrl: language-dependent blog URL (ru→fxtun.ru, en→fxtun.dev) - robots.txt: add 16 AI bots organized by vendor - llms.txt/llms-full.txt: fix broken links, cross-domain URLs - vite.config: sitemap defaults (weekly, priority 0.7) - Add separate IndexNow key for fxtun.dev domain
1 parent d213f5e commit 3a2f544

4 files changed

Lines changed: 23 additions & 9 deletions

File tree

web/src/components/landing/LandingFooter.vue

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,14 @@
22
import { RouterLink } from 'vue-router'
33
import { useI18n } from 'vue-i18n'
44
import { computed } from 'vue'
5+
import { getBlogUrl } from '@/i18n'
56
67
const { t, locale } = useI18n()
78
89
const currentYear = new Date().getFullYear()
910
1011
const showOffer = computed(() => locale.value === 'ru')
11-
const blogUrl = computed(() => {
12-
if (typeof window === 'undefined') return '/blog'
13-
return `${window.location.protocol}//${window.location.hostname}/blog`
14-
})
12+
const blogUrl = computed(() => getBlogUrl())
1513
</script>
1614

1715
<template>

web/src/i18n/index.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ export function getDomainLocale(): 'en' | 'ru' | null {
88
if (import.meta.env.SSR) return null
99
const host = window.location.hostname
1010
if (host === 'fxtun.ru' || host.endsWith('.fxtun.ru')) return 'ru'
11+
if (host === 'fxtun.dev' || host.endsWith('.fxtun.dev')) return 'en'
12+
if (host === 'mfdev.ru' || host.endsWith('.mfdev.ru')) return 'en'
1113
return null
1214
}
1315

@@ -28,6 +30,19 @@ export const i18n = createI18n<[MessageSchema], 'en' | 'ru'>({
2830
},
2931
})
3032

33+
if (!import.meta.env.SSR) {
34+
const locale = getDefaultLocale()
35+
localStorage.setItem('locale', locale)
36+
document.documentElement.lang = locale
37+
}
38+
39+
export function getBlogUrl(): string {
40+
if (import.meta.env.SSR) return '/blog'
41+
const locale = getLocale()
42+
const domain = locale === 'ru' ? 'fxtun.ru' : 'fxtun.dev'
43+
return `${window.location.protocol}//${domain}/blog`
44+
}
45+
3146
export function setLocale(locale: 'en' | 'ru') {
3247
// @ts-expect-error vue-i18n composition api
3348
i18n.global.locale.value = locale

web/src/views/LandingView.vue

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script setup lang="ts">
22
import { ref, computed, onMounted, onUnmounted } from 'vue'
33
import { useThemeStore, type ThemeMode } from '@/stores/theme'
4-
import { setLocale, getLocale } from '@/i18n'
4+
import { setLocale, getLocale, getBlogUrl } from '@/i18n'
55
import { useI18n } from 'vue-i18n'
66
import { RouterLink } from 'vue-router'
77
import { useSeo } from '@/composables/useSeo'
@@ -44,10 +44,7 @@ function cycleTheme() {
4444
themeStore.setMode(modes[nextIndex])
4545
}
4646
47-
const blogUrl = computed(() => {
48-
if (typeof window === 'undefined') return '/blog'
49-
return `${window.location.protocol}//${window.location.hostname}/blog`
50-
})
47+
const blogUrl = computed(() => getBlogUrl())
5148
5249
function handleScroll() {
5350
isScrolled.value = window.scrollY > 20

web/vite.config.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ export default defineConfig({
1111
dynamicRoutes: ["/login", "/register", "/offer"],
1212
exclude: ["/docs/offer", "/ru", "/ru/*", "/en", "/en/*"],
1313
generateRobotsTxt: false,
14+
changefreq: "weekly",
15+
priority: 0.7,
16+
robots: [{ userAgent: "*", allow: "/" }],
17+
readable: true,
1418
}),
1519
],
1620
resolve: {

0 commit comments

Comments
 (0)