mirror of
https://gitlab.dit.htwk-leipzig.de/htwk-software/htwkalender.git
synced 2026-01-17 12:02:26 +01:00
add static site generation including robots.txt and sitemap.xml
This commit is contained in:
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user