From 9125c1bd4a2cf5b49a478cd27083185a3628f81d Mon Sep 17 00:00:00 2001 From: Nicholas Thompson Date: Sun, 23 Jun 2024 22:56:28 +0100 Subject: [PATCH] Trying to switch to better URL handling --- .github/workflows/deploy.yml | 3 +++ scripts/sitemap.mjs | 6 +++--- src/router/index.js | 10 +++++++--- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 7120dfc..d6fda34 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -27,6 +27,9 @@ jobs: - name: Build Sitemap run: npm run sitemap + - name: 404 handling + run: cp dist/index.html dist/404.html + - name: Install SSH Client uses: webfactory/ssh-agent@v0.9.0 with: diff --git a/scripts/sitemap.mjs b/scripts/sitemap.mjs index a8c9b9d..2ba4abc 100644 --- a/scripts/sitemap.mjs +++ b/scripts/sitemap.mjs @@ -18,9 +18,9 @@ sitemap.pipe(writeStream); items.map(item => sitemap.write({ - url: `${BASE_URL}/#/${item.name}`, - changefreq: "daily", - priority: 0.3 + url: `${BASE_URL}/${item.name}`, + changefreq: "weekly", + priority: 0.5 }) ); diff --git a/src/router/index.js b/src/router/index.js index 33c0215..b5b86da 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -1,11 +1,15 @@ -import { createRouter, createWebHashHistory } from "vue-router"; +import { createRouter, createWebHistory } from "vue-router"; import McHome from "@/views/McHome.vue"; const router = createRouter({ - history: createWebHashHistory(), + history: createWebHistory(), routes: [ { - path: "/:item_name?", + path: '/', + redirect: { name: 'Home' } + }, + { + path: "/minecraft-item-browser/:item_name?", name: "Home", component: McHome, props: true,