Blog: add date field to allArticles, sort newest first, show date on cards

This commit is contained in:
Hermes Agent
2026-08-08 18:57:52 +00:00
parent 8d7a0ea43a
commit 3bb194d408
+5 -2
View File
@@ -194,9 +194,11 @@
<script> <script>
// All blog articles data // All blog articles data
const allArticles = [ const allArticles = [
{ slug:"brief-semanal-2026-08-07.html", cat:"Brief Semanal", time:"3 min", title:"Brief semanal Odoo — 7 agosto 2026", excerpt:"La OCA lanza su nuevo Apps Store, novedades del blog oficial de Odoo y actualizaciones en los módulos Community. Tu resumen semanal del ecosistema Odoo.", tag:"news" }, { slug:"brief-semanal-2026-08-07.html", cat:"Brief Semanal", time:"3 min", date:"2026-08-07", title:"Brief semanal Odoo — 7 agosto 2026", excerpt:"La OCA lanza su nuevo Apps Store, novedades del blog oficial de Odoo y actualizaciones en los módulos Community. Tu resumen semanal del ecosistema Odoo.", tag:"news" },
{ slug:"odoo-xml-rpc-hermes-agent.html", cat:"Guía Técnica", time:"6 min", title:"Conecta Odoo con Hermes Agent vía XML-RPC", excerpt:"Guía paso a paso para conectar Odoo Community con Hermes Agent usando XML-RPC. Sin middleware, sin MCP, sin n8n. Tu agente IA hablando directamente con tu ERP.", tag:"guide" } { slug:"odoo-xml-rpc-hermes-agent.html", cat:"Guía Técnica", time:"6 min", date:"2026-07-28", title:"Conecta Odoo con Hermes Agent vía XML-RPC", excerpt:"Guía paso a paso para conectar Odoo Community con Hermes Agent usando XML-RPC. Sin middleware, sin MCP, sin n8n. Tu agente IA hablando directamente con tu ERP.", tag:"guide" }
]; ];
// Sort newest first
allArticles.sort((a, b) => b.date.localeCompare(a.date));
const perPage = 6; const perPage = 6;
let currentPage = 1; let currentPage = 1;
let filteredArticles = [...allArticles]; let filteredArticles = [...allArticles];
@@ -215,6 +217,7 @@ function renderBlog() {
<div style="display:flex;gap:8px;margin-bottom:16px;flex-wrap:wrap;"> <div style="display:flex;gap:8px;margin-bottom:16px;flex-wrap:wrap;">
<span style="background:${tagColors[a.tag]||tagColors.guide};color:${tagText[a.tag]||tagText.guide};font-size:0.75rem;font-weight:500;padding:4px 10px;border-radius:100px;">${a.cat}</span> <span style="background:${tagColors[a.tag]||tagColors.guide};color:${tagText[a.tag]||tagText.guide};font-size:0.75rem;font-weight:500;padding:4px 10px;border-radius:100px;">${a.cat}</span>
<span style="background:rgba(16,185,129,0.1);color:#10b981;font-size:0.75rem;font-weight:500;padding:4px 10px;border-radius:100px;">${a.time}</span> <span style="background:rgba(16,185,129,0.1);color:#10b981;font-size:0.75rem;font-weight:500;padding:4px 10px;border-radius:100px;">${a.time}</span>
<span style="color:#94a3b8;font-size:0.75rem;font-weight:400;padding:4px 0;margin-left:auto;">${a.date}</span>
</div> </div>
<h3 style="font-size:1.125rem;font-weight:600;color:#0f172a;margin-bottom:8px;line-height:1.4;">${a.title}</h3> <h3 style="font-size:1.125rem;font-weight:600;color:#0f172a;margin-bottom:8px;line-height:1.4;">${a.title}</h3>
<p style="color:#64748b;font-size:0.875rem;line-height:1.7;margin-bottom:16px;flex:1;">${a.excerpt}</p> <p style="color:#64748b;font-size:0.875rem;line-height:1.7;margin-bottom:16px;flex:1;">${a.excerpt}</p>