mirror of
https://github.com/Ocelot-Social-Community/ocelot.social.git
synced 2026-04-04 00:25:24 +00:00
fix redirect
This commit is contained in:
parent
1581b14de2
commit
f09031d449
@ -1,10 +1,14 @@
|
||||
import { defineClientConfig } from "vuepress/client";
|
||||
import DonationBar from "./components/DonationBar.vue";
|
||||
import MiniBlog from "./components/MiniBlog.vue";
|
||||
import RedirectHome from "./components/RedirectHome.vue";
|
||||
|
||||
export default defineClientConfig({
|
||||
enhance({ app }) {
|
||||
app.component("DonationBar", DonationBar);
|
||||
app.component("MiniBlog", MiniBlog);
|
||||
},
|
||||
layouts: {
|
||||
RedirectHome,
|
||||
},
|
||||
});
|
||||
|
||||
20
docs/.vuepress/components/RedirectHome.vue
Normal file
20
docs/.vuepress/components/RedirectHome.vue
Normal file
@ -0,0 +1,20 @@
|
||||
<template>
|
||||
<div></div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { onMounted } from 'vue'
|
||||
|
||||
onMounted(() => {
|
||||
const lang = (navigator.language || 'de').split('-')[0].toLowerCase()
|
||||
|
||||
const localeMap = {
|
||||
de: '/de/',
|
||||
en: '/en/',
|
||||
es: '/es/',
|
||||
fr: '/fr/',
|
||||
}
|
||||
|
||||
window.location.replace(localeMap[lang] || '/de/')
|
||||
})
|
||||
</script>
|
||||
@ -1,6 +1,7 @@
|
||||
---
|
||||
home: true
|
||||
home: false
|
||||
article: false
|
||||
sidebar: false
|
||||
title: Ocelot.Social
|
||||
navbar: false
|
||||
layout: RedirectHome
|
||||
---
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user