add static site generation including robots.txt and sitemap.xml

This commit is contained in:
survellow
2024-07-03 17:33:12 +02:00
parent a003ba736c
commit cf638cf93c
31 changed files with 846 additions and 923 deletions

View File

@ -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,