abtmtr-v4/views/domain/scripts/data_get_domain.js

19 lines
603 B
JavaScript
Raw Normal View History

const data_get = document.getElementById("data_get");
2024-01-19 16:28:16 +00:00
fetch_ask("https://blog.abtmtr.link/api/collections/paste/posts/domain")
.then((x) => x.json())
.then((paste) => {
const data = JSON.parse(paste.data.body);
data_get.innerHTML = data.reduce(
(html, subdomain) =>
html +
2024-01-19 16:28:16 +00:00
`<h1><a href="${subdomain.url}" target="_blank">${
subdomain.name
}</a></h1>
2023-12-21 06:23:50 +00:00
${subdomain.description.map((x) => `<p>${x}</p>`).join("")}
2024-01-19 16:28:16 +00:00
<img src="${subdomain.src}" alt="${subdomain.name}" title="${
subdomain.name
}" />`,
""
);
});