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

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