diff --git a/app/frontend/.env.example b/app/frontend/.env.example index bbfd6fe..9d22a74 100644 --- a/app/frontend/.env.example +++ b/app/frontend/.env.example @@ -1,2 +1,2 @@ PUBLIC_GOOGLE_ANALYTICS_ID= -PUBLIC_HOST_URL=http://localhost:3003 \ No newline at end of file +PUBLIC_BASE_URL=http://localhost:3003 \ No newline at end of file diff --git a/app/frontend/src/components/Article.astro b/app/frontend/src/components/Article.astro index dfb57dc..c4c6295 100644 --- a/app/frontend/src/components/Article.astro +++ b/app/frontend/src/components/Article.astro @@ -2,7 +2,7 @@ --- -
+


What is
CoverItUp? @@ -88,4 +88,6 @@ repositories in an organization.

- + diff --git a/app/frontend/src/components/LineChart.astro b/app/frontend/src/components/LineChart.astro index fa7d235..831c117 100644 --- a/app/frontend/src/components/LineChart.astro +++ b/app/frontend/src/components/LineChart.astro @@ -3,7 +3,7 @@
+

Embeds

@@ -344,21 +344,25 @@ const hostURL = import.meta.env.PUBLIC_HOST_URL; location.reload(); }; - let hostURL = ""; + const currentURL = window.location.origin; - let hostURLQ = document.querySelector("[data-host-url]"); - if (hostURLQ) { - hostURL = hostURLQ.getAttribute("data-host-url"); + let baseURL = document + .querySelector("[data-base-url]") + ?.getAttribute("data-base-url"); + + if (!baseURL) { + baseURL = currentURL; } - if (!hostURL) { - hostURL = window.location.origin; + if (!baseURL.startsWith("http")) { + baseURL = currentURL + baseURL; } + const urlParams = new URLSearchParams(window.location.search); const org = urlParams.get("org"); const repo = urlParams.get("repo"); let branch = urlParams.get("branch"); document.getElementById("org-repo-name").innerText = `${org}/${repo}`; - fetch(`${hostURL}/api/readme?org=${org}&repo=${repo}`) + fetch(`${baseURL}/api/readme?org=${org}&repo=${repo}`) .then((response) => response.json()) .then((data) => { if (!branch && data.branches.length > 0) { @@ -370,7 +374,7 @@ const hostURL = import.meta.env.PUBLIC_HOST_URL; d.org = org; d.repo = repo; d.branch = branch; - d.url = hostURL.replace("https://", "").replace("http://", ""); + d.url = baseURL.replace("https://", "").replace("http://", ""); }); document diff --git a/app/frontend/src/components/Themes.astro b/app/frontend/src/components/Themes.astro index b229479..57ab6ff 100644 --- a/app/frontend/src/components/Themes.astro +++ b/app/frontend/src/components/Themes.astro @@ -29,7 +29,15 @@ > Medium: Revolutionizing code tracking for developers - +
+
+
+ + See Sample +