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