Écran TFT Raspberry Pi

(function () { var renderArticleMeta = async function () { if (!document.body.classList.contains('single-post') || document.querySelector('.miqi-post-meta')) return; var title = document.querySelector('h1.wp-block-post-title'); if (!title) return; var apiLink = document.querySelector('link[rel="alternate"][type="application/json"]'); var postMatch = document.body.className.match(/\bpostid-(\d+)\b/); var endpoint = apiLink ? apiLink.href : (postMatch ? location.origin + '/wp-json/wp/v2/posts/' + postMatch[1] : ''); if (!endpoint) return; try { var joiner = endpoint.indexOf('?') === -1 ? '?' : '&'; var response = await fetch(endpoint + joiner + '_embed=author&_fields=date,_embedded'); if (!response.ok) return; var post = await response.json(); var author = post._embedded && post._embedded.author && post._embedded.author[0]; if (!author || !post.date) return; if (!document.getElementById('miqi-post-meta-styles')) { var style = document.createElement('style'); style.id = 'miqi-post-meta-styles'; style.textContent = '.single-post .miqi-post-meta{display:flex;align-items:center;flex-wrap:wrap;gap:18px;margin:12px 0 18px;padding-bottom:14px;border-bottom:1px solid #e4e7eb;color:#6b7280;font-size:16px;line-height:1.5}.single-post .miqi-post-meta__item{display:inline-flex;align-items:center;gap:7px}.single-post .miqi-post-meta__icon{display:inline-flex;align-items:center;flex:none;color:#6b7280}.single-post .miqi-post-meta__icon svg{width:16px;height:16px}.single-post .miqi-post-meta__author{color:#0068a7;text-decoration:none;font-weight:400}.single-post .miqi-post-meta__author:hover{text-decoration:underline}.single-post .miqi-post-meta time{color:#6b7280}@media(max-width:640px){.single-post .miqi-post-meta{align-items:flex-start;flex-direction:column;gap:8px}}'; document.head.appendChild(style); } var meta = document.createElement('div'); meta.className = 'miqi-post-meta'; meta.setAttribute('aria-label', 'Détails de l'article'); var authorItem = document.createElement('span'); authorItem.className = 'miqi-post-meta__item'; var authorIcon = document.createElement('span'); authorIcon.className = 'miqi-post-meta__icon'; authorIcon.setAttribute('aria-hidden', 'true'); authorIcon.innerHTML = ''; var authorName = document.createElement(author.link ? 'a' : 'span'); authorName.className = 'miqi-post-meta__author'; authorName.textContent = author.name || « Affichage Miqi » ; if (author.link) { authorName.href = author.link; authorName.rel = 'auteur'; } authorItem.append(authorIcon, authorName); var dateItem = document.createElement('span'); dateItem.className = 'miqi-post-meta__item'; var dateIcon = document.createElement('span'); dateIcon.className = 'miqi-post-meta__icon'; dateIcon.setAttribute('aria-hidden', 'true'); dateIcon.innerHTML = ''; var published = document.createElement('time'); published.dateTime = post.date; published.textContent = new Intl.DateTimeFormat('en-US', { year: 'numeric', month: 'long', day: 'numeric' }).format(new Date(post.date)); dateItem.append(dateIcon, published); meta.append(authorItem, dateItem); title.insertAdjacentElement('afterend', meta); } catch (error) { return; } }; if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', renderArticleMeta, { once: true }); } else { renderArticleMeta(); } })();