From 8e070661ab9739e5aec37210e8f2305e41312f8a Mon Sep 17 00:00:00 2001
From: David Ashby
Date: Sun, 20 Mar 2022 15:40:51 -0400
Subject: [PATCH] make URLs easier on the eyes
---
index.html | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/index.html b/index.html
index 10ae0eb..7481e28 100644
--- a/index.html
+++ b/index.html
@@ -568,7 +568,7 @@
{{#website}}
- - {{website}}
+ - {{cleanedWebsite}}
{{/website}}
- Events: {{events}}
- Café: {{cafe}}
@@ -606,6 +606,7 @@
$.each(data, function (key, value) {
value.rowNumber = key;
value.slug = slugify(value.name);
+ value.cleanedWebsite = cleanWebsite(value.website);
});
$("#storeCount").html(data.length);
window.data = data;
@@ -637,6 +638,14 @@
.replace(/^-|-$/g, "");
}
+ function cleanWebsite(str) {
+ return str
+ .toLowerCase()
+ .replace(/^https?:\/\//g, "")
+ .replace(/^www./g, "")
+ .replace(/\/$/g, "");
+ }
+
function getStoreBySlug(slug) {
var ret = false;
$.each(window.data, function (key, value) {