Skip to content

Commit

Permalink
Fix build issue
Browse files Browse the repository at this point in the history
  • Loading branch information
jgthms committed Jan 11, 2024
1 parent 2ad384c commit 3c490cf
Show file tree
Hide file tree
Showing 4 changed files with 1,917 additions and 2,337 deletions.
46 changes: 24 additions & 22 deletions docs/_javascript/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,28 +97,30 @@ document.addEventListener("DOMContentLoaded", () => {

const $amis = document.getElementById("amis");

fetch("https://jgthms.com/amis/new.json")
.then((response) => {
if (!response.ok) {
throw new Error(`HTTP error! Status: ${response.status}`);
}

return response.json();
})
.then((response) => {
response.forEach((item) => {
const el = document.createElement("a");
el.className = "bd-sponsor-item bd-partner-sponsor";
el.href = "url";
el.target = "_blank";
el.title = item.title || item.id;

const extension = item.svg ? ".svg" : ".png";
const img = document.createElement("img");
img.src = `https://jgthms.com/amis/images/${item.id}${extension}`;

el.appendChild(img);
$amis.appendChild(el);
if ($amis) {
fetch("https://jgthms.com/amis/new.json")
.then((response) => {
if (!response.ok) {
throw new Error(`HTTP error! Status: ${response.status}`);
}

return response.json();
})
.then((response) => {
response.forEach((item) => {
const el = document.createElement("a");
el.className = "bd-sponsor-item bd-partner-sponsor";
el.href = "url";
el.target = "_blank";
el.title = item.title || item.id;

const extension = item.svg ? ".svg" : ".png";
const img = document.createElement("img");
img.src = `https://jgthms.com/amis/images/${item.id}${extension}`;

el.appendChild(img);
$amis.appendChild(el);
});
});
}
});

0 comments on commit 3c490cf

Please sign in to comment.