This is an automated email from the ASF dual-hosted git repository.

paulk-asert pushed a commit to branch asf-site
in repository https://gitbox.apache.org/repos/asf/groovy-website.git


The following commit(s) were added to refs/heads/asf-site by this push:
     new 1c6990b  fix broken images
1c6990b is described below

commit 1c6990b90ef7efecf4833b1c26a0284a671fba02
Author: Paul King <[email protected]>
AuthorDate: Sat May 30 09:04:07 2026 +1000

    fix broken images
---
 generator/src/main/groovy/generator/SiteGenerator.groovy |  2 +-
 site/src/site/blog/groovy6-functional.adoc               |  2 +-
 site/src/site/pages/blog.groovy                          | 14 +++++++++-----
 3 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/generator/src/main/groovy/generator/SiteGenerator.groovy 
b/generator/src/main/groovy/generator/SiteGenerator.groovy
index af644b9..40b740f 100644
--- a/generator/src/main/groovy/generator/SiteGenerator.groovy
+++ b/generator/src/main/groovy/generator/SiteGenerator.groovy
@@ -297,7 +297,7 @@ class SiteGenerator {
                 blogImgDir.mkdirs()
                 def attrs = Attributes.builder()
                         .attribute('imagesoutdir', blogImgDir.absolutePath)
-                        .attribute('imagesdir', 'img')
+                        .attribute('imagesdir', '.')
                         .build()
                 // SafeMode.UNSAFE lets asciidoctor-diagram write to
                 // imagesoutdir even though it's outside the source-file
diff --git a/site/src/site/blog/groovy6-functional.adoc 
b/site/src/site/blog/groovy6-functional.adoc
index c9d7674..f3e72f0 100644
--- a/site/src/site/blog/groovy6-functional.adoc
+++ b/site/src/site/blog/groovy6-functional.adoc
@@ -746,7 +746,7 @@ you'd rather skip the metadata altogether.
 same compile-time pass that emitted the executor — not hand-drawn,
 not maintained separately, regenerated on every build:
 
-[plantuml,WordCount,svg]
+[plantuml,img/WordCount,svg]
 ----
 @startuml WordCount
 left to right direction
diff --git a/site/src/site/pages/blog.groovy b/site/src/site/pages/blog.groovy
index ec88a54..bf18a74 100644
--- a/site/src/site/pages/blog.groovy
+++ b/site/src/site/pages/blog.groovy
@@ -27,14 +27,18 @@ layout 'layouts/main.groovy', true,
             script { yieldUnescaped 
"document.addEventListener('DOMContentLoaded',prettyPrint)" }
         },
         mainContent: contents {
-            // imagesoutdir + imagesdir let asciidoctor-diagram write
-            // generated images (e.g. from [plantuml,…] blocks) into
-            // blog/img/ and emit relative `img/…` references that
-            // match the convention used for pre-rendered blog images.
+            // imagesoutdir tells asciidoctor-diagram where to write
+            // generated images (e.g. from [plantuml,…] blocks) — it
+            // points at blog/img/. imagesdir is '.' so it is not
+            // prepended to image targets: pre-rendered blog images
+            // already carry the `img/` prefix in their macros, and
+            // diagram blocks supply it via their target (e.g.
+            // [plantuml,img/WordCount,svg]). Anything other than '.'
+            // here double-prefixes the pre-rendered images (img/img/…).
             Map options = [attributes:[
                     DOCS_BASEURL: DocUtils.DOCS_BASEURL,
                     imagesoutdir: imagesoutdir,
-                    imagesdir   : 'img'
+                    imagesdir   : '.'
             ]]
             def notesAsHTML = asciidocText(notes,options)
             def matcher = notesAsHTML =~ /<h2 id="(.+?)">(.+?)<\/h2>/

Reply via email to