<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Hugo - Tag - arleo.eu</title><link>https://www.arleo.eu/en/tags/hugo/</link><description>Hugo - Tag - arleo.eu</description><generator>Hugo -- gohugo.io</generator><language>en</language><lastBuildDate>Fri, 29 May 2026 20:30:00 +0200</lastBuildDate><atom:link href="https://www.arleo.eu/en/tags/hugo/" rel="self" type="application/rss+xml"/><item><title>Hugo SEO: Googlebot 404s, noindex aliases and sitemap normalization</title><link>https://www.arleo.eu/en/posts/debug-seo-404-broken-links/</link><pubDate>Fri, 29 May 2026 20:30:00 +0200</pubDate><author>Jmr</author><guid>https://www.arleo.eu/en/posts/debug-seo-404-broken-links/</guid><description><![CDATA[<div class="featured-image">
                <img src="/images/debug-seo-404-broken-links-featured.jpg" referrerpolicy="no-referrer">
            </div><h2 id="context">Context</h2>
<p>Google Search Console was reporting four categories of issues on arleo.eu:</p>
<ul>
<li><strong>Googlebot 404s</strong>: <code>/fr/tag/cloudflare</code>, <code>/en/tag/nginx</code>, <code>/fr/tag/javascript</code>… URLs with <code>/fr/</code> prefix or singular <code>/tag/</code> never served by nginx</li>
<li><strong>16 &ldquo;Excluded by noindex tag&rdquo; pages</strong>: all redirect pages generated by <code>aliases:</code> in Hugo frontmatter</li>
<li><strong>Robots tag</strong>: <code>noodp</code> hardcoded in the LoveIt theme</li>
<li><strong>FR/EN sitemap</strong>: 104 vs 105 URLs — a duplicate FR tag and two missing tags</li>
</ul>
<hr>
<h2 id="act-1-hugo-aliases--nginx-301-redirects">Act 1: Hugo aliases → nginx 301 redirects</h2>
<h3 id="why-hugo-generates-noindex-pages">Why Hugo generates noindex pages</h3>
<p>Hugo generates <code>aliases:</code> frontmatter entries as static HTML files:</p>]]></description></item><item><title>Hugo: freezing Mermaid diagrams to static dark/light SVGs</title><link>https://www.arleo.eu/en/posts/debug-mermaid-svg-freeze/</link><pubDate>Fri, 29 May 2026 20:00:00 +0200</pubDate><author>Jmr</author><guid>https://www.arleo.eu/en/posts/debug-mermaid-svg-freeze/</guid><description><![CDATA[<div class="featured-image">
                <img src="/images/debug-mermaid-svg-freeze-featured.jpg" referrerpolicy="no-referrer">
            </div><h2 id="problem">Problem</h2>
<p>Mermaid diagrams on arleo.eu were rendering client-side via <code>cdn.jsdelivr.net</code>. Three concrete consequences:</p>
<ol>
<li><strong>CSP constraint</strong> — <code>script-src cdn.jsdelivr.net</code> and <code>worker-src cdn.jsdelivr.net</code> become mandatory (Mermaid v11 uses Web Workers for its parsers).</li>
<li><strong>Render flash</strong> — the diagram appears after JS execution, creating a visible delay.</li>
<li><strong>Dark theme ignored</strong> — Mermaid initialized the SVG in light mode even when the site theme was dark.</li>
</ol>
<p>The solution: generate SVGs <strong>at build time</strong> with <code>mmdc</code>, outside any browser context.</p>]]></description></item><item><title>CSP A+ on Hugo + Cloudflare: from hash-based to origin allowlist, auto-monitoring and hardening</title><link>https://www.arleo.eu/en/posts/csp-a-plus-hugo-cloudflare-origin-allowlist/</link><pubDate>Thu, 28 May 2026 23:45:41 +0200</pubDate><author>Jmr</author><guid>https://www.arleo.eu/en/posts/csp-a-plus-hugo-cloudflare-origin-allowlist/</guid><description><![CDATA[<div class="featured-image">
                <img src="/images/csp-a-plus-hugo-cloudflare-origin-allowlist-featured.jpg" referrerpolicy="no-referrer">
            </div><h2 id="context">Context</h2>
<p>arleo.eu runs on Hugo (KVM VM) → OpenResty (NUC) → Cloudflare (CDN/WAF). Goal: <strong>A+ score on Mozilla Observatory</strong> with a strict CSP that resists edge-side injections.</p>
<p>The journey went through three strategies over a few weeks — nonces, hashes, then origin allowlist — before landing on a stable, automated solution.</p>
<hr>
<h2 id="act-1-why-hash-based-failed">Act 1: why hash-based failed</h2>
<p>The initial idea seemed solid: Hugo Pipes externalizes all JS with SRI, we list the hashes in the CSP, clean result. In practice, two problems made the approach impossible.</p>]]></description></item><item><title>SRI on Hugo: automated hashes, auto-update and BetterStack alerting</title><link>https://www.arleo.eu/en/posts/sri-cdn-hugo-automate/</link><pubDate>Sun, 17 May 2026 00:00:00 +0000</pubDate><author>Jmr</author><guid>https://www.arleo.eu/en/posts/sri-cdn-hugo-automate/</guid><description><![CDATA[<div class="featured-image">
                <img src="/images/sri-cdn-hugo-automate-featured.jpg" referrerpolicy="no-referrer">
            </div><h2 id="why-sri">Why SRI?</h2>
<p>When your site loads resources from a third-party CDN — FontAwesome, Mermaid, Animate.css — you&rsquo;re trusting an external party you have no control over. If jsdelivr.net gets compromised, or if a supposedly immutable version is silently mutated, your site can become an attack vector.</p>
<p><strong>Subresource Integrity</strong> (SRI) solves this cleanly: every <code>&lt;link&gt;</code> or <code>&lt;script&gt;</code> tag carries an <code>integrity=&quot;sha256-…&quot;</code> attribute that the browser verifies before executing the resource. If the hash doesn&rsquo;t match, the browser blocks the load.</p>]]></description></item><item><title>CSP Hash on Hugo: migrating from nonce to hash to preserve CDN cache</title><link>https://www.arleo.eu/en/posts/csp-hash-hugo/</link><pubDate>Sat, 16 May 2026 00:00:00 +0000</pubDate><author>Jmr</author><guid>https://www.arleo.eu/en/posts/csp-hash-hugo/</guid><description>&lt;div class="featured-image">
                &lt;img src="/images/csp-hash-hugo-featured.png" referrerpolicy="no-referrer">
            &lt;/div>CSP nonces and CDN caching are incompatible by design. On a Hugo static site, SHA-256 hashes are the native approach: computed at build time, stable across requests, and fully compatible with Cloudflare caching.</description></item><item><title>Postmortem: TypeIt broken by Mermaid in LoveIt theme</title><link>https://www.arleo.eu/en/posts/postmortem-typeit-mermaid/</link><pubDate>Thu, 14 May 2026 09:46:31 +0200</pubDate><author>Jmr</author><guid>https://www.arleo.eu/en/posts/postmortem-typeit-mermaid/</guid><description><![CDATA[<div class="featured-image">
                <img src="/images/postmortem-typeit-mermaid-featured.jpg" referrerpolicy="no-referrer">
            </div><h2 id="tldr">TL;DR</h2>
<p>The LoveIt theme&rsquo;s typewriter animation (TypeIt) stopped working on the home after adding Mermaid diagrams to posts. Cause: a <code>#id-1</code> DOM selector shared between both libraries. When Mermaid finds an orphan block in a home summary, its initialization crashes, and the JS init chain stops before reaching TypeIt. Fix: add `</p>]]></description></item><item><title>hugo-mcp Cloudflare plugin: smart cache purge</title><link>https://www.arleo.eu/en/posts/hugo-mcp-plugin-cloudflare/</link><pubDate>Thu, 14 May 2026 09:43:19 +0200</pubDate><author>Jmr</author><guid>https://www.arleo.eu/en/posts/hugo-mcp-plugin-cloudflare/</guid><description><![CDATA[<div class="featured-image">
                <img src="/images/hugo-mcp-plugin-cloudflare-featured.jpg" referrerpolicy="no-referrer">
            </div><h2 id="tldr">TL;DR</h2>
<p>The Cloudflare plugin in <a href="https://github.com/jmrGrav/hugo-mcp/releases/tag/v2.0.0" target="_blank" rel="noopener noreffer ">hugo-mcp v2.0</a> implements 3 cache purge modes (<code>full</code>, <code>partial</code>, <code>smart</code>). The <code>partial</code> mode computes the linked URLs to invalidate (canonical + sitemap + RSS + listing + home) to preserve 95% of the CDN cache on every modification. Concretely: 6 URLs purged instead of wiping everything. This post details the computation, the pitfalls, and why <code>smart</code> became the default.</p>]]></description></item><item><title>hugo-mcp v2.0: a Python plugin-system in 200 lines</title><link>https://www.arleo.eu/en/posts/hugo-mcp-plugins-architecture/</link><pubDate>Sat, 09 May 2026 23:52:28 +0200</pubDate><author>Jmr</author><guid>https://www.arleo.eu/en/posts/hugo-mcp-plugins-architecture/</guid><description><![CDATA[<div class="featured-image">
                <img src="/images/hugo-mcp-plugins-architecture-featured.jpg" referrerpolicy="no-referrer">
            </div><h2 id="tldr">TL;DR</h2>
<p><a href="https://github.com/jmrGrav/hugo-mcp/releases/tag/v2.0.0" target="_blank" rel="noopener noreffer ">hugo-mcp v2.0.0</a> introduces a <strong>Python plugin-system</strong> that lets anyone add hooks after each <code>create_page</code> / <code>update_page</code> / <code>delete_page</code> operation. 200 lines of code for the core, 3 production plugins shipped (IndexNow, Google Indexing, Cloudflare). This post explains the design, the trade-offs, the security posture, and shows how to write your own plugin in 5 minutes.</p>]]></description></item><item><title>Grav → Hugo migration: 2 years of blog flipped in one day</title><link>https://www.arleo.eu/en/posts/migration-grav-hugo/</link><pubDate>Sat, 09 May 2026 22:33:22 +0200</pubDate><author>Jmr</author><guid>https://www.arleo.eu/en/posts/migration-grav-hugo/</guid><description><![CDATA[<div class="featured-image">
                <img src="/images/migration-grav-hugo-featured.jpg" referrerpolicy="no-referrer">
            </div><h2 id="tldr">TL;DR</h2>
<p>On May 9, 2026, I switched <code>arleo.eu</code> from <strong>Grav</strong> (PHP CMS) to <strong>Hugo</strong> (Go static site generator) in a single session. <strong>Atomic flip</strong> (≈ 0 second downtime), 22 legacy articles migrated under <code>/posts/</code> with <strong>SEO aliases</strong> to preserve Google-indexed URLs, BetterStack <code>/ping</code> monitoring intact throughout the operation.</p>
<p>The code and migration script are open source: <a href="https://github.com/jmrGrav/grav-to-hugo-migration" target="_blank" rel="noopener noreffer ">github.com/jmrGrav/grav-to-hugo-migration</a>.</p>]]></description></item><item><title>MCP security sprint delivered: v1.9.0, 10 chantiers, hardened ecosystem</title><link>https://www.arleo.eu/en/posts/sprint-securite-mcp-livre/</link><pubDate>Sat, 09 May 2026 18:44:12 +0200</pubDate><author>Jmr</author><guid>https://www.arleo.eu/en/posts/sprint-securite-mcp-livre/</guid><description><![CDATA[<div class="featured-image">
                <img src="/images/sprint-securite-mcp-livre-featured.jpg" referrerpolicy="no-referrer">
            </div><h2 id="tldr">TL;DR</h2>
<p>On May 9, 2026, I delivered all 10 chantiers of the MCP security sprint that <a href="/en/posts/roadmap-sprint-securite-mcp/" rel="">I had announced earlier in the day</a> in a single marathon session. <code>hugo-mcp</code> is now at <strong>v1.9.0</strong> (<a href="https://github.com/jmrGrav/hugo-mcp/releases/tag/v1.9.0" target="_blank" rel="noopener noreffer ">GitHub Release</a>), commit <code>1404f83</code> GPG-signed.</p>
<p>Here&rsquo;s the high-level recap + a pedagogical deep-dive on 2 chantiers with real value beyond my specific context: <strong>C2 token rotation</strong> and <strong>C6 internal TLS</strong>.</p>
<h2 id="recap-of-10-chantiers">Recap of 10 chantiers</h2>
<table>
  <thead>
      <tr>
          <th>#</th>
          <th>Chantier</th>
          <th>Implementation</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>C1</td>
          <td>Rate limiting</td>
          <td><code>slowapi</code>, 60 req/min per IP</td>
      </tr>
      <tr>
          <td>C2</td>
          <td>Token rotation</td>
          <td><code>tokens.json</code> + <code>token_mgr.py</code> CLI</td>
      </tr>
      <tr>
          <td>C3</td>
          <td>JSON audit logs</td>
          <td><code>structlog</code>, machine-readable events</td>
      </tr>
      <tr>
          <td>C4</td>
          <td>Strict Pydantic v2</td>
          <td><code>CreatePageArgs</code> / <code>UpdatePageArgs</code> with constraints</td>
      </tr>
      <tr>
          <td>C5</td>
          <td>bcrypt cost-12</td>
          <td>Tokens hashed in storage</td>
      </tr>
      <tr>
          <td>C6</td>
          <td>NUC ↔ VM TLS</td>
          <td>EC P-256 cert, uvicorn SSL, proxy verifies the cert</td>
      </tr>
      <tr>
          <td>C7</td>
          <td>requirements.lock</td>
          <td>SHA-256 hashes via <code>pip-compile --generate-hashes</code></td>
      </tr>
      <tr>
          <td>C8</td>
          <td>Info disclosure</td>
          <td>Docs off, generic exception handler, <code>proxy_hide_header</code></td>
      </tr>
      <tr>
          <td>C9</td>
          <td>nginx WAF</td>
          <td>POST + <code>application/json</code> enforcement on <code>/mcp</code>, OWASP CRS active</td>
      </tr>
      <tr>
          <td>C10</td>
          <td>Backup DR</td>
          <td><code>backup.sh</code> GPG-encrypted, 30-day retention</td>
      </tr>
  </tbody>
</table>
<p>Full details in the <a href="https://github.com/jmrGrav/hugo-mcp/blob/main/CHANGELOG.md" target="_blank" rel="noopener noreffer ">CHANGELOG v1.9.0</a> and commit <a href="https://github.com/jmrGrav/hugo-mcp/commit/1404f83" target="_blank" rel="noopener noreffer ">1404f83</a>.</p>]]></description></item></channel></rss>