Skip to content

Commit

Permalink
Update routes for GitHub Pages
Browse files Browse the repository at this point in the history
  • Loading branch information
svsh195 committed Aug 5, 2023
1 parent 1ba7f43 commit 280e740
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
12 changes: 6 additions & 6 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@
<img src="./assets/bars.svg">
</button>
<div class="nav-items">
<a href="/" class="nav-link">Regular</a>
<a href="/public" class="nav-link yellow">Public</a>
<a href="/military" class="nav-link black">Military</a>
<a href="/diplomatic" class="nav-link red">Diplomatic</a>
<a href="/emergency" class="nav-link blue">Emergency</a>
<a href="/special" class="nav-link">Special</a>
<a href="/VehiclePlates/" class="nav-link">Regular</a>
<a href="/VehiclePlates/public" class="nav-link yellow">Public</a>
<a href="/VehiclePlates/military" class="nav-link black">Military</a>
<a href="/VehiclePlates/diplomatic" class="nav-link red">Diplomatic</a>
<a href="/VehiclePlates/emergency" class="nav-link blue">Emergency</a>
<a href="/VehiclePlates/special" class="nav-link">Special</a>
</div>
</div>
</div>
Expand Down
14 changes: 7 additions & 7 deletions src/js/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,32 +14,32 @@ document.addEventListener("click", (event) => {
})

const routes = {
"/": {
"/VehiclePlates/": {
name: "regular",
template: "regular.html",
title: "Regular plates"
},
"/public": {
"/VehiclePlates/public": {
name: "public",
template: "public.html",
title: "Public plates"
},
"/military": {
"/VehiclePlates/military": {
name: "military",
template: "military.html",
title: "Military plates"
},
"/diplomatic": {
"/VehiclePlates/diplomatic": {
name: "diplomatic",
template: "diplomatic.html",
title: "Diplomatic plates"
},
"/emergency": {
"/VehiclePlates/emergency": {
name: "emergency",
template: "emergency.html",
title: "Emergency plates"
},
"/special": {
"/VehiclePlates/special": {
name: "special",
template: "special.html",
title: "Special plates"
Expand All @@ -56,7 +56,7 @@ function route(event) {
async function locationHandler() {
const location = window.location.pathname;
if (location.length == 0) {
location = "/";
location = "/VehiclePlates/";
}
const route = routes[location];
const html = await fetch("./src/views/" + route.template).then((response) => response.text());
Expand Down

0 comments on commit 280e740

Please sign in to comment.