From c4d64ec65c3154d806c2abdbdad30158dc69d7a5 Mon Sep 17 00:00:00 2001 From: Richard Dern Date: Wed, 15 Oct 2025 01:25:09 +0200 Subject: [PATCH] Forcer la sortie des diagrammes en png --- themes/42/layouts/_partials/media/render-image.html | 4 ++-- tools/generate_mermaid_diagrams.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/themes/42/layouts/_partials/media/render-image.html b/themes/42/layouts/_partials/media/render-image.html index 5ade2e77..93fae273 100644 --- a/themes/42/layouts/_partials/media/render-image.html +++ b/themes/42/layouts/_partials/media/render-image.html @@ -11,7 +11,7 @@ {{- $description := default $data.description | default $title -}} {{- $image := .Page.Resources.GetMatch $imgPath -}} {{- $display := $image }} -{{- if gt $display.Height 810 }} +{{- if and $display (ne $display.MediaType.SubType "svg") (gt $display.Height 810) }} {{- $display = $image.Resize "x810" -}} {{- end }}
@@ -38,4 +38,4 @@

{{- end }} {{- end }} -
\ No newline at end of file + diff --git a/tools/generate_mermaid_diagrams.js b/tools/generate_mermaid_diagrams.js index 3734ef49..3f683b11 100644 --- a/tools/generate_mermaid_diagrams.js +++ b/tools/generate_mermaid_diagrams.js @@ -149,7 +149,7 @@ async function ensurePuppeteerConfig() { async function renderMermaidDiagram(inputPath, outputPath) { const cliPath = getMermaidCliPath(); - const args = ['-i', inputPath, '-o', outputPath]; + const args = ['-i', inputPath, '-o', outputPath, '-e', 'png']; const env = { ...process.env }; const executablePath = resolvePuppeteerExecutablePath(); @@ -206,7 +206,7 @@ async function generateDiagrams(bundlePath) { } const relativePath = path.relative(diagramsRoot, mermaidFile); - const outputRelative = relativePath.replace(/\.mermaid$/i, '.svg'); + const outputRelative = relativePath.replace(/\.mermaid$/i, '.png'); const outputPath = path.join(bundlePath, OUTPUT_DIR, outputRelative); await ensureDirectory(path.dirname(outputPath));