const data_get = document.getElementById("data_get"); const urlParams = new URLSearchParams(window.location.search); const source = urlParams.get("src") || "blog"; const blog = urlParams.get("blog") || "mtr"; fetch( `https://${source}.abtmtr.link/api/collections/${blog}/posts?body=html&page=${ urlParams.get("page") || 1 }` ) .then((x) => x.json()) .then(({ data }) => { data_get.innerHTML = ` ${data.posts .map( (post) => `

${post.title}

Posted ${new Date(post.created).toLocaleDateString()}

${source == "img" ? `

` : ""}` ) .join("")} `; });