mirror of
https://gitlab.dit.htwk-leipzig.de/htwk-software/htwkalender-pwa.git
synced 2025-07-16 09:38:51 +02:00
add static site generation including robots.txt and sitemap.xml
This commit is contained in:
1
frontend/.gitignore
vendored
1
frontend/.gitignore
vendored
@ -10,6 +10,7 @@ lerna-debug.log*
|
||||
node_modules
|
||||
dist
|
||||
dist-ssr
|
||||
.vite-ssg-temp
|
||||
*.local
|
||||
|
||||
# Editor directories and files
|
||||
|
@ -1,5 +1,5 @@
|
||||
<!doctype html>
|
||||
<html<!--app-html-attrs--> lang="en">
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" href="/favicon.ico" sizes="32x32" />
|
||||
@ -12,13 +12,9 @@
|
||||
href="/themes/lara-light-blue/theme.css"
|
||||
/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>HTWKalender</title>
|
||||
<!--app-head-tags-->
|
||||
</head>
|
||||
<body<!--app-body-attrs-->>
|
||||
<!--app-body-tags-open-->
|
||||
<body>
|
||||
<div id="app"><!--app-html--></div>
|
||||
<script type="module" src="/src/entry-client.ts"></script>
|
||||
<!--app-body-tags-->
|
||||
<script type="module" src="/src/main.ts"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
1483
frontend/package-lock.json
generated
1483
frontend/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -4,10 +4,8 @@
|
||||
"version": "0.0.0",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "node src/server",
|
||||
"build": "vue-tsc && npm run build:client && npm run build:server",
|
||||
"build:client": "vite build --outDir dist/client",
|
||||
"build:server": "vite build --outDir dist/server --ssr src/entry-server.ts",
|
||||
"dev": "vite",
|
||||
"build": "vue-tsc && vite-ssg build",
|
||||
"preview": "vite preview",
|
||||
"lint": "eslint --ext .js,.vue --ignore-path .gitignore --fix src",
|
||||
"lint-no-fix": "eslint --ext .js,.vue --ignore-path .gitignore src",
|
||||
@ -25,14 +23,12 @@
|
||||
"@unhead/ssr": "^1.9.14",
|
||||
"@unhead/vue": "^1.9.10",
|
||||
"@vueuse/core": "^10.9.0",
|
||||
"compression": "^1.7.4",
|
||||
"express": "^4.19.2",
|
||||
"pinia": "^2.1.7",
|
||||
"primeflex": "^3.3.1",
|
||||
"primeicons": "^6.0.1",
|
||||
"primevue": "^3.50.0",
|
||||
"sirv": "^2.0.4",
|
||||
"source-sans": "^3.46.0",
|
||||
"vite-ssg": "^0.23.7",
|
||||
"vue": "^3.4.11",
|
||||
"vue-i18n": "^9.10.2",
|
||||
"vue-router": "^4.3.0"
|
||||
@ -52,6 +48,7 @@
|
||||
"terser": "^5.31.0",
|
||||
"typescript": "^5.4.3",
|
||||
"vite": "^5.2.7",
|
||||
"vite-ssg-sitemap": "^0.7.1",
|
||||
"vitest": "^1.4.0",
|
||||
"vue-tsc": "^1.8.27"
|
||||
}
|
||||
|
@ -1,2 +0,0 @@
|
||||
User-agent: *
|
||||
Allow: /
|
@ -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,
|
||||
|
@ -17,6 +17,9 @@
|
||||
import { Module } from "../model/module.ts";
|
||||
|
||||
export async function createIndividualFeed(modules: Module[]): Promise<string> {
|
||||
if (import.meta.env.SSR) {
|
||||
return "";
|
||||
}
|
||||
try {
|
||||
const response = await fetch("/api/feed", {
|
||||
method: "POST",
|
||||
@ -62,6 +65,9 @@ export async function saveIndividualFeed(
|
||||
token: string,
|
||||
modules: Module[],
|
||||
): Promise<string> {
|
||||
if (import.meta.env.SSR) {
|
||||
return "";
|
||||
}
|
||||
await fetch("/api/collections/feeds/records/" + token, {
|
||||
method: "PATCH",
|
||||
headers: {
|
||||
@ -81,6 +87,9 @@ export async function saveIndividualFeed(
|
||||
}
|
||||
|
||||
export async function deleteIndividualFeed(token: string): Promise<void> {
|
||||
if (import.meta.env.SSR) {
|
||||
return;
|
||||
}
|
||||
await fetch("/api/feed?token=" + token, {
|
||||
method: "DELETE",
|
||||
})
|
||||
|
@ -19,6 +19,9 @@
|
||||
import { Module } from "../model/module.ts";
|
||||
|
||||
export async function fetchCourse(): Promise<string[]> {
|
||||
if (import.meta.env.SSR) {
|
||||
return [];
|
||||
}
|
||||
const courses: string[] = [];
|
||||
await fetch("/api/courses")
|
||||
.then((response) => {
|
||||
@ -39,6 +42,9 @@ export async function fetchCourse(): Promise<string[]> {
|
||||
export async function fetchCourseBySemester(
|
||||
semester: string,
|
||||
): Promise<string[]> {
|
||||
if (import.meta.env.SSR) {
|
||||
return [];
|
||||
}
|
||||
const courses: string[] = [];
|
||||
await fetch("/api/courses/events?semester=" + semester)
|
||||
.then((response) => {
|
||||
@ -60,6 +66,9 @@ export async function fetchModulesByCourseAndSemester(
|
||||
course: string,
|
||||
semester: string,
|
||||
): Promise<Module[]> {
|
||||
if (import.meta.env.SSR) {
|
||||
return [];
|
||||
}
|
||||
const modules: Module[] = [];
|
||||
await fetch("/api/course/modules?course=" + course + "&semester=" + semester)
|
||||
.then((response) => {
|
||||
@ -86,6 +95,9 @@ export async function fetchModulesByCourseAndSemester(
|
||||
}
|
||||
|
||||
export async function fetchAllModules(): Promise<Module[]> {
|
||||
if (import.meta.env.SSR) {
|
||||
return [];
|
||||
}
|
||||
const modules: Module[] = [];
|
||||
await fetch("/api/modules")
|
||||
.then((response) => {
|
||||
|
@ -17,6 +17,9 @@
|
||||
// function to fetch course data from the API
|
||||
|
||||
export async function fetchEventTypes(): Promise<string[]> {
|
||||
if (import.meta.env.SSR) {
|
||||
return [];
|
||||
}
|
||||
const eventTypes: string[] = [];
|
||||
await fetch("/api/events/types")
|
||||
.then((response) => {
|
||||
@ -30,4 +33,4 @@ export async function fetchEventTypes(): Promise<string[]> {
|
||||
});
|
||||
});
|
||||
return eventTypes;
|
||||
}
|
||||
}
|
||||
|
@ -17,6 +17,9 @@
|
||||
import { Module } from "../model/module";
|
||||
|
||||
export async function fetchModule(module: Module): Promise<Module> {
|
||||
if (import.meta.env.SSR) {
|
||||
return new Module("", "", "", "", "", "", "", false, []);
|
||||
}
|
||||
// request to the data-manager on /api/module with query parameters name as the module name
|
||||
const request = new Request("/api/module?uuid=" + module.uuid);
|
||||
|
||||
|
@ -17,6 +17,9 @@
|
||||
import { AnonymizedEventDTO } from "../model/event.ts";
|
||||
|
||||
export async function fetchRoom(): Promise<string[]> {
|
||||
if (import.meta.env.SSR) {
|
||||
return [];
|
||||
}
|
||||
const rooms: string[] = [];
|
||||
await fetch("/api/rooms")
|
||||
.then((response) => {
|
||||
@ -33,6 +36,9 @@ export async function fetchEventsByRoomAndDuration(
|
||||
from_date: string,
|
||||
to_date: string,
|
||||
): Promise<AnonymizedEventDTO[]> {
|
||||
if (import.meta.env.SSR) {
|
||||
return [];
|
||||
}
|
||||
const events: AnonymizedEventDTO[] = [];
|
||||
await fetch(
|
||||
"/api/schedule?room=" + room + "&from=" + from_date + "&to=" + to_date,
|
||||
|
@ -18,6 +18,9 @@ import { Module } from "../model/module";
|
||||
import { Calendar } from "../model/calendar";
|
||||
|
||||
export async function getCalender(token: string): Promise<Module[]> {
|
||||
if (import.meta.env.SSR) {
|
||||
return [];
|
||||
}
|
||||
const request = new Request("/api/collections/feeds/records/" + token, {
|
||||
method: "GET",
|
||||
});
|
||||
|
@ -19,6 +19,9 @@ export async function requestFreeRooms(
|
||||
from: string,
|
||||
to: string,
|
||||
): Promise<string[]> {
|
||||
if (import.meta.env.SSR) {
|
||||
return [];
|
||||
}
|
||||
const rooms: string[] = [];
|
||||
await fetch("/api/rooms/free?from=" + from + "&to=" + to)
|
||||
.then((response) => {
|
||||
|
@ -27,7 +27,7 @@ import {
|
||||
DataTableRowUnselectEvent,
|
||||
} from "primevue/datatable";
|
||||
import { useDialog } from "primevue/usedialog";
|
||||
import router from "../router";
|
||||
import { router } from "@/main";
|
||||
import { fetchModule } from "../api/fetchModule.ts";
|
||||
import { useI18n } from "vue-i18n";
|
||||
import { fetchEventTypes } from "../api/fetchEvents.ts";
|
||||
|
@ -26,7 +26,7 @@ import { CalendarOptions, DatesSetArg, EventInput } from "@fullcalendar/core";
|
||||
import { fetchEventsByRoomAndDuration } from "../api/fetchRoom.ts";
|
||||
import { useI18n } from "vue-i18n";
|
||||
import allLocales from "@fullcalendar/core/locales-all";
|
||||
import router from "@/router";
|
||||
import { router } from "@/main";
|
||||
import { formatYearMonthDay } from "@/helpers/dates";
|
||||
import { useQuery } from "@tanstack/vue-query";
|
||||
import { watch } from "vue";
|
||||
|
@ -27,7 +27,7 @@ function setup() {
|
||||
_i18n = createI18n({
|
||||
legacy: false,
|
||||
locale: localeStore().locale,
|
||||
fallbackLocale: "en",
|
||||
fallbackLocale: "de",
|
||||
messages: {
|
||||
en,
|
||||
de,
|
||||
|
@ -16,8 +16,7 @@
|
||||
|
||||
import "source-sans/source-sans-3.css";
|
||||
|
||||
import { createApp } from "vue";
|
||||
import { createHead } from "@unhead/vue";
|
||||
import { ViteSSG } from "vite-ssg";
|
||||
import "./style.css";
|
||||
import App from "./App.vue";
|
||||
import PrimeVue from "primevue/config";
|
||||
@ -36,7 +35,7 @@ import Slider from "primevue/slider";
|
||||
import ToggleButton from "primevue/togglebutton";
|
||||
import "primeicons/primeicons.css";
|
||||
import "primeflex/primeflex.css";
|
||||
import router from "./router";
|
||||
import routes from "./router";
|
||||
import SpeedDial from "primevue/speeddial";
|
||||
import TabView from "primevue/tabview";
|
||||
import TabPanel from "primevue/tabpanel";
|
||||
@ -57,57 +56,81 @@ import Skeleton from "primevue/skeleton";
|
||||
import Calendar from "primevue/calendar";
|
||||
import i18n from "./i18n";
|
||||
import { VueQueryPlugin } from "@tanstack/vue-query";
|
||||
import { Router } from "vue-router";
|
||||
|
||||
const app = createApp(App);
|
||||
const pinia = createPinia();
|
||||
var router : Router;
|
||||
|
||||
app.use(VueQueryPlugin, {
|
||||
queryClientConfig: {
|
||||
defaultOptions: {
|
||||
queries: {
|
||||
refetchOnWindowFocus: false,
|
||||
},
|
||||
},
|
||||
export const createApp = ViteSSG(
|
||||
App,
|
||||
{
|
||||
base: import.meta.env.BASE_URL,
|
||||
routes: routes.routes,
|
||||
},
|
||||
});
|
||||
(ctx) => {
|
||||
const { app } = ctx;
|
||||
const pinia = createPinia();
|
||||
app.use(pinia);
|
||||
|
||||
const head = createHead();
|
||||
app.use(head);
|
||||
router = ctx.router;
|
||||
|
||||
app.use(PrimeVue);
|
||||
app.use(router);
|
||||
app.use(ToastService);
|
||||
app.use(pinia);
|
||||
app.use(DialogService);
|
||||
i18n.setup();
|
||||
app.use(i18n.vueI18n);
|
||||
app.component("Avatar", Avatar);
|
||||
app.component("Badge", Badge);
|
||||
app.component("Button", Button);
|
||||
app.component("Menu", Menu);
|
||||
app.component("Menubar", Menubar);
|
||||
app.component("Dialog", Dialog);
|
||||
app.component("Dropdown", Dropdown);
|
||||
app.component("InputText", InputText);
|
||||
app.component("InputSwitch", InputSwitch);
|
||||
app.component("Card", Card);
|
||||
app.component("DataView", DataView);
|
||||
app.component("Slider", Slider);
|
||||
app.component("ToggleButton", ToggleButton);
|
||||
app.component("SpeedDial", SpeedDial);
|
||||
app.component("TabView", TabView);
|
||||
app.component("TabPanel", TabPanel);
|
||||
app.component("MultiSelect", MultiSelect);
|
||||
app.component("Tag", Tag);
|
||||
app.component("Toast", Toast);
|
||||
app.component("Accordion", Accordion);
|
||||
app.component("AccordionTab", AccordionTab);
|
||||
app.component("DataTable", DataTable);
|
||||
app.component("Column", Column);
|
||||
app.component("DynamicDialog", DynamicDialog);
|
||||
app.component("ProgressSpinner", ProgressSpinner);
|
||||
app.component("Checkbox", Checkbox);
|
||||
app.component("Skeleton", Skeleton);
|
||||
app.component("Calendar", Calendar);
|
||||
router.beforeEach(async (to, from) => {
|
||||
const newLocale = to.params.locale;
|
||||
const prevLocale = from.params.locale;
|
||||
// If the locale hasn't changed, do nothing
|
||||
if (newLocale === prevLocale) {
|
||||
return;
|
||||
}
|
||||
i18n.setLocale(newLocale);
|
||||
});
|
||||
|
||||
app.mount("#app");
|
||||
app.use(VueQueryPlugin, {
|
||||
queryClientConfig: {
|
||||
defaultOptions: {
|
||||
queries: {
|
||||
refetchOnWindowFocus: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
//app.config.globalProperties.$hostname = "https://cal.htwk-leipzig.de"
|
||||
|
||||
app.use(router);
|
||||
app.use(ToastService);
|
||||
app.use(DialogService);
|
||||
i18n.setup();
|
||||
app.use(i18n.vueI18n);
|
||||
|
||||
app.use(PrimeVue);
|
||||
app.component("Avatar", Avatar);
|
||||
app.component("Badge", Badge);
|
||||
app.component("Button", Button);
|
||||
app.component("Menu", Menu);
|
||||
app.component("Menubar", Menubar);
|
||||
app.component("Dialog", Dialog);
|
||||
app.component("Dropdown", Dropdown);
|
||||
app.component("InputText", InputText);
|
||||
app.component("InputSwitch", InputSwitch);
|
||||
app.component("Card", Card);
|
||||
app.component("DataView", DataView);
|
||||
app.component("Slider", Slider);
|
||||
app.component("ToggleButton", ToggleButton);
|
||||
app.component("SpeedDial", SpeedDial);
|
||||
app.component("TabView", TabView);
|
||||
app.component("TabPanel", TabPanel);
|
||||
app.component("MultiSelect", MultiSelect);
|
||||
app.component("Tag", Tag);
|
||||
app.component("Toast", Toast);
|
||||
app.component("Accordion", Accordion);
|
||||
app.component("AccordionTab", AccordionTab);
|
||||
app.component("DataTable", DataTable);
|
||||
app.component("Column", Column);
|
||||
app.component("DynamicDialog", DynamicDialog);
|
||||
app.component("ProgressSpinner", ProgressSpinner);
|
||||
app.component("Checkbox", Checkbox);
|
||||
app.component("Skeleton", Skeleton);
|
||||
app.component("Calendar", Calendar);
|
||||
},
|
||||
)
|
||||
|
||||
export {router}
|
||||
|
@ -14,7 +14,7 @@
|
||||
//You should have received a copy of the GNU Affero General Public License
|
||||
//along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
import { createMemoryHistory, createRouter, createWebHistory } from "vue-router";
|
||||
import { createMemoryHistory, RouterOptions, createWebHistory } from "vue-router";
|
||||
|
||||
const CourseSelection = () => import("../view/CourseSelection.vue");
|
||||
const AdditionalModules = () => import("../view/create/AdditionalModules.vue");
|
||||
@ -28,9 +28,7 @@ const EditAdditionalModules = () =>
|
||||
const EditModules = () => import("../view/edit/EditModules.vue");
|
||||
const Faq = () => import("../view/Faq.vue");
|
||||
|
||||
import i18n from "../i18n";
|
||||
|
||||
const router = createRouter({
|
||||
const routes : RouterOptions = {
|
||||
history: import.meta.env.SSR ? createMemoryHistory(import.meta.env.BASE_URL) : createWebHistory(import.meta.env.BASE_URL),
|
||||
routes: [
|
||||
{
|
||||
@ -136,16 +134,6 @@ const router = createRouter({
|
||||
}
|
||||
},
|
||||
],
|
||||
});
|
||||
};
|
||||
|
||||
router.beforeEach(async (to, from) => {
|
||||
const newLocale = to.params.locale;
|
||||
const prevLocale = from.params.locale;
|
||||
// If the locale hasn't changed, do nothing
|
||||
if (newLocale === prevLocale) {
|
||||
return;
|
||||
}
|
||||
i18n.setLocale(newLocale);
|
||||
});
|
||||
|
||||
export default router;
|
||||
export default routes;
|
||||
|
@ -20,7 +20,7 @@ import { useLocalStorage } from "@vueuse/core";
|
||||
const localeStore = defineStore("localeStore", {
|
||||
state: () => {
|
||||
return {
|
||||
locale: useLocalStorage("locale", "en"), //useLocalStorage takes in a key of 'count' and default value of 0
|
||||
locale: useLocalStorage("locale", "de"), //useLocalStorage takes in a key of 'count' and default value of 0
|
||||
};
|
||||
},
|
||||
actions: {
|
||||
|
@ -19,14 +19,14 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
<script lang="ts" setup>
|
||||
import tokenStore from "@/store/tokenStore.ts";
|
||||
import { useToast } from "primevue/usetoast";
|
||||
import { computed, onMounted } from "vue";
|
||||
import router from "@/router";
|
||||
import { computed, inject, onMounted } from "vue";
|
||||
import { router } from "@/main";
|
||||
import { useI18n } from "vue-i18n";
|
||||
const { t } = useI18n({ useScope: "global" });
|
||||
|
||||
const toast = useToast();
|
||||
|
||||
const domain = window.location.hostname;
|
||||
const domain = inject<string>("domain")!;
|
||||
|
||||
const getLink = () =>
|
||||
"https://" + domain + "/api/feed?token=" + tokenStore().token;
|
||||
|
@ -27,7 +27,7 @@ import ModuleSelection from "@/components/ModuleSelection.vue";
|
||||
import { Module } from "@/model/module.ts";
|
||||
import { useI18n } from "vue-i18n";
|
||||
import moduleStore from "@/store/moduleStore";
|
||||
import router from "@/router";
|
||||
import { router } from "@/main";
|
||||
|
||||
async function getModules() {
|
||||
modules.value = await fetchModulesByCourseAndSemester(
|
||||
|
@ -42,7 +42,7 @@ const hasContent = computed(() => {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<heading class="flex flex-column align-items-center mt-0">
|
||||
<div class="flex flex-column align-items-center mt-0">
|
||||
<div
|
||||
class="flex align-items-center justify-content-center gap-3 mx-2 mb-4 transition-rolldown"
|
||||
:class="{ 'md:mt-8': hideContent }"
|
||||
@ -87,7 +87,7 @@ const hasContent = computed(() => {
|
||||
>
|
||||
<slot name="content"></slot>
|
||||
</div>
|
||||
</heading>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
@ -18,7 +18,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
<script lang="ts" setup>
|
||||
import moduleStore from "@/store/moduleStore";
|
||||
import router from "@/router";
|
||||
import {router} from "@/main";
|
||||
import AdditionalModuleTable from "@/components/AdditionalModuleTable.vue";
|
||||
|
||||
const store = moduleStore();
|
||||
|
@ -19,7 +19,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
<script setup lang="ts">
|
||||
import moduleStore from "@/store/moduleStore.ts";
|
||||
import { createIndividualFeed } from "@/api/createFeed.ts";
|
||||
import router from "@/router";
|
||||
import { router } from "@/main";
|
||||
import tokenStore from "@/store/tokenStore.ts";
|
||||
import { Ref, computed, inject, ref, onMounted } from "vue";
|
||||
import ModuleTemplateDialog from "@/components/ModuleTemplateDialog.vue";
|
||||
|
@ -19,7 +19,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
<script lang="ts" setup>
|
||||
import { defineAsyncComponent } from "vue";
|
||||
import moduleStore from "@/store/moduleStore";
|
||||
import router from "@/router";
|
||||
import { router } from "@/main";
|
||||
|
||||
const store = moduleStore();
|
||||
const AdditionalModuleTable = defineAsyncComponent(
|
||||
|
@ -21,7 +21,7 @@ import { Ref, ref } from "vue";
|
||||
import { Module } from "@/model/module";
|
||||
import moduleStore from "@/store/moduleStore";
|
||||
import { getCalender } from "@/api/loadCalendar";
|
||||
import router from "@/router";
|
||||
import { router } from "@/main";
|
||||
import tokenStore from "@/store/tokenStore";
|
||||
import { useToast } from "primevue/usetoast";
|
||||
import { useI18n } from "vue-i18n";
|
||||
|
@ -23,7 +23,7 @@ import moduleStore from "@/store/moduleStore";
|
||||
import { fetchAllModules } from "@/api/fetchCourse.ts";
|
||||
import { deleteIndividualFeed, saveIndividualFeed } from "@/api/createFeed.ts";
|
||||
import tokenStore from "@/store/tokenStore";
|
||||
import router from "@/router";
|
||||
import { router } from "@/main";
|
||||
import ModuleTemplateDialog from "@/components/ModuleTemplateDialog.vue";
|
||||
import { onlyWhitespace } from "@/helpers/strings.ts";
|
||||
import { useI18n } from "vue-i18n";
|
||||
|
@ -151,7 +151,7 @@ import DynamicPage from "@/view/DynamicPage.vue";
|
||||
import { requestFreeRooms } from "@/api/requestFreeRooms.ts";
|
||||
import { FilterMatchMode } from "primevue/api";
|
||||
import { padStart } from "@fullcalendar/core/internal";
|
||||
import router from "@/router";
|
||||
import { router } from "@/main";
|
||||
import { formatYearMonthDay } from "@/helpers/dates";
|
||||
|
||||
const mobilePage = inject("mobilePage") as Ref<boolean>;
|
||||
|
@ -22,7 +22,7 @@ import { fetchRoom } from "@/api/fetchRoom.ts";
|
||||
import DynamicPage from "@/view/DynamicPage.vue";
|
||||
import RoomOccupation from "@/components/RoomOccupation.vue";
|
||||
import { computedAsync } from "@vueuse/core";
|
||||
import router from "@/router";
|
||||
import { router } from "@/main";
|
||||
|
||||
type Room = {
|
||||
name: string;
|
||||
|
@ -20,7 +20,8 @@
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"paths": {
|
||||
"@/*": ["./src/*"]
|
||||
"@/*": ["./src/*"],
|
||||
"primevue/*": ["./node_modules/primevue/*"]
|
||||
}
|
||||
},
|
||||
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"],
|
||||
|
@ -18,7 +18,12 @@ import { defineConfig } from "vite";
|
||||
import vue from "@vitejs/plugin-vue";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import resolve from "@rollup/plugin-node-resolve";
|
||||
import {resolve as pathResolver} from "path";
|
||||
import terser from "@rollup/plugin-terser";
|
||||
import ViteSSGOptions from "vite-ssg";
|
||||
import generateSitemap from 'vite-ssg-sitemap'
|
||||
|
||||
const hostname = "https://cal.htwk-leipzig.de";
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
@ -28,8 +33,27 @@ export default defineConfig({
|
||||
terser(),
|
||||
],
|
||||
resolve: {
|
||||
alias: {
|
||||
"@": fileURLToPath(new URL("./src", import.meta.url)),
|
||||
alias:
|
||||
{
|
||||
"@": fileURLToPath(new URL("./src", import.meta.url)),
|
||||
'primevue' : pathResolver(__dirname, 'node_modules/primevue'),
|
||||
},
|
||||
extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.css', '.scss'],
|
||||
},
|
||||
ssgOptions: {
|
||||
script: "async",
|
||||
formatting: "minify",
|
||||
format: "esm",
|
||||
onFinished: () => {
|
||||
generateSitemap({
|
||||
hostname: hostname,
|
||||
exclude: [
|
||||
'/additional-modules',
|
||||
'/edit-additional-modules',
|
||||
'/edit-calendar',
|
||||
'/rename-modules',
|
||||
]
|
||||
})
|
||||
},
|
||||
},
|
||||
server: {
|
||||
|
Reference in New Issue
Block a user