mirror of
https://gitlab.dit.htwk-leipzig.de/htwk-software/htwkalender.git
synced 2025-07-22 04:28:47 +02:00
add static site generation including robots.txt and sitemap.xml
This commit is contained in:
@ -19,7 +19,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
<script lang="ts" setup>
|
||||
import MenuBar from "./components/MenuBar.vue";
|
||||
import { RouteRecordName, RouterView, useRoute, useRouter } from "vue-router";
|
||||
import { useHead, useServerSeoMeta } from "@unhead/vue";
|
||||
import { useHead, useServerHead, useServerSeoMeta } from "@unhead/vue";
|
||||
import CalendarPreview from "./components/CalendarPreview.vue";
|
||||
import moduleStore from "./store/moduleStore.ts";
|
||||
import { computed, provide, ref } from "vue";
|
||||
@ -42,7 +42,10 @@ const disabledPages = [
|
||||
// Provide canonical link for SEO
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const baseUri = "https://cal.htwk-leipzig.de"; // could be stored in .env
|
||||
|
||||
const domain = "cal.htwk-leipzig.de"
|
||||
provide('domain', domain);
|
||||
const baseUri = "https://" + domain;
|
||||
const canonical = computed(() => `${baseUri}${router.resolve(route.name ? { name: route.name } : route).path}`);
|
||||
const title = computed(() => route.meta.label?
|
||||
`HTWKalender - ${t(String(route.meta.label))}`:
|
||||
@ -64,6 +67,10 @@ useHead({
|
||||
]
|
||||
});
|
||||
|
||||
// SEO optimization
|
||||
useServerHead({
|
||||
title: title
|
||||
});
|
||||
useServerSeoMeta(
|
||||
{
|
||||
title: title,
|
||||
|
Reference in New Issue
Block a user