Skip to content

Commit 87cffb9

Browse files
committedSep 4, 2022
getCity: added a better way to handle url key.
1 parent 23cc74b commit 87cffb9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎getCity.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export default async function (city) {
1919
doc.querySelectorAll(".Search-Result-title").forEach((link) => {
2020
results.push({
2121
city: link.innerText,
22-
url: link.href.replace("http://127.0.0.1:5500", "").replace("https://mostlyemre.github.io", ""),
22+
url: "/" + link.href.split("/").slice(-3).join("/"),
2323
});
2424
});
2525
return results;

0 commit comments

Comments
 (0)
Please sign in to comment.