From f2e585f8dee5aba8522bbe622f4d6573648073b4 Mon Sep 17 00:00:00 2001 From: Ben Soares Date: Thu, 28 Apr 2022 14:47:55 +0100 Subject: [PATCH] JAL-3989 add in issue shortcodes to the archive version page changes list --- build.gradle | 65 +++++++++++++++++++++++----------------------------------- 1 file changed, 26 insertions(+), 39 deletions(-) diff --git a/build.gradle b/build.gradle index b0d0fbb..79fb2d9 100644 --- a/build.gradle +++ b/build.gradle @@ -2476,52 +2476,39 @@ task hugoTemplates { summary += (patchReleaseString != null) ? " is the ${patchReleaseString} release in the ${JALVIEW_VERSION.substring(0,lastDotIndex)} series." : "" } - if (headings[1] != null && headings[1].size() > 0) { - def noheadings = true - releaseCells[1].children().each { e -> - if (e.tagName().toLowerCase() == "ul") { - e.select("li").each { li -> - def mdItem = "- " - li.childNodes().any {n -> - if (n.nodeName().equals("#comment")) { - mdItem += "${n} " - return true + [1,2].each { col -> + if (headings[col] != null && headings[col].size() > 0) { + def noheadings = true + releaseCells[col].children().each { e -> + if (e.tagName().toLowerCase() == "ul") { + e.select("li").each { li -> + def issues = [] + def mdItem = "- " + li.childNodes().any {n -> + if (n.nodeName().equals("#comment")) { + mdItem += "${n} " + issues = n.getData().trim().split(/[,\s]+/) + return true + } } - } - mdItem += li.text() - if (noheadings) { - changes += "\n### ${headings[1]}\n\n" - noheadings = false - } - changes += "${mdItem}\n" - } - } else if (e.tag() == "em") { - changes += "\n#### ${e.text()}\n\n" - noheadings = false - } - } - } - - if (headings[2] != null && headings[2].size() > 0) { - changes += "\n### ${headings[2]}\n\n" - releaseCells[2].children().each { e -> - if (e.tagName().toLowerCase() == "ul") { - e.select("li").each { li -> - def mdItem = "- " - li.childNodes().any {n -> - if (n.nodeName().equals("#comment")) { - mdItem += "${n} " - return true + mdItem += li.text() + issues.each { jal -> + mdItem += " {{< jal issue=\"${jal}\" >}}" } + if (noheadings) { + changes += "\n### ${headings[1]}\n\n" + noheadings = false + } + changes += "${mdItem}\n" } - mdItem += li.text() - changes += "${mdItem}\n" + } else if (e.tag() == "em") { + changes += "\n#### ${e.text()}\n\n" + noheadings = false } - } else if (e.tagName().toLowerCase() == "em") { - changes += "\n#### ${e.text()}\n\n" } } } + } } } -- 1.7.10.2