1(function hydrateMiraHomepage() { 2 const content = window.MiraHomepageData; 3 if (!content) return; 4 5 function updateImage(image, item) { 6 if (!image || !item) return; 7 image.src = item.image; 8 image.alt = item.imageAlt || item.title; 9 } 10 11 function updateTime(time, item) { 12 if (!time || !item) return; 13 time.dateTime = item.dateISO; 14 time.textContent = item.dateHuman; 15 } 16 17 function updateFeatured(selector, item, featuredLabel) { 18 if (!item) return; 19 20 const card = document.querySelector(selector); 21 const link = card?.querySelector("a"); 22 if (!card || !link) return; 23 24 link.href = item.url; 25 link.setAttribute("aria-label", `Leer noticia: ${item.title}`); 26 updateImage(card.querySelector("img"), item); 27 updateTime(card.querySelector("time"), item); 28 29 const category = card.querySelector("[class$='__meta'] span"); 30 const title = card.querySelector("h3"); 31 const excerpt = card.querySelector(".featured-news__content > p, .bogota-featured__content > p"); 32 33 if (category) category.textContent = featuredLabel || item.category; 34 if (title) title.textContent = item.title; 35 if (excerpt) excerpt.textContent = item.excerpt; 36 } 37 38 function updateSupportingCards(cardSelector, items) { 39 const cards = [...document.querySelectorAll(cardSelector)]; 40 41 cards.forEach((card, index) => { 42 const item = items?.[index]; 43 if (!item) return; 44 45 const link = card.querySelector("a"); 46 if (link) { 47 link.href = item.url; 48 link.setAttribute("aria-label", `Leer noticia: ${item.title}`); 49 } 50 51 updateImage(card.querySelector("img"), item); 52 updateTime(card.querySelector("time"), item); 53 54 const category = card.querySelector("[class$='__meta'] span"); 55 const title = card.querySelector("h3"); 56 if (category) category.textContent = item.category; 57 if (title) title.textContent = item.title; 58 }); 59 } 60 61 updateFeatured(".featured-news", content.featured, "Destacada"); 62 updateSupportingCards(".news-card", content.latest); 63 64 const bogotaItems = Array.isArray(content.bogota) ? content.bogota : []; 65 updateFeatured(".bogota-featured", bogotaItems[0], "Bogotá"); 66 updateSupportingCards(".bogota-card", bogotaItems.slice(1)); 67})(); 68
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.