From: Ben Soares Date: Thu, 28 Apr 2022 13:47:55 +0000 (+0100) Subject: JAL-3989 add in issue shortcodes to the archive version page changes list X-Git-Tag: Release_2_11_2_6~64^2~14 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=f2e585f8dee5aba8522bbe622f4d6573648073b4;p=jalview.git JAL-3989 add in issue shortcodes to the archive version page changes list --- 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" } } } + } } }