From 36e56a4c92be3d3adc807a41718aa3237eeabf6c Mon Sep 17 00:00:00 2001 From: Helena Rasche Date: Mon, 9 Oct 2023 14:45:58 +0200 Subject: [PATCH] fix news --- bin/news.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/bin/news.rb b/bin/news.rb index 589adc2fa054a8..181d6d25ddb00f 100755 --- a/bin/news.rb +++ b/bin/news.rb @@ -69,7 +69,7 @@ def onlyEnabled(x) end def linkify(text, path) - "[#{text}](https://training.galaxyproject.org/training-material/#{path}?utm_source=matrix&utm_medium=newsbot&utm_campaign=matrix-news)" + "[#{text.gsub('|', '-')}](https://training.galaxyproject.org/training-material/#{path}?utm_source=matrix&utm_medium=newsbot&utm_campaign=matrix-news)" end def printableMaterial(path) @@ -131,12 +131,12 @@ def format_tutorials(added, modified, kind: "tutorials") end if added.length.positive? - output += "\n\nNew Tutorials:\n\n" + output += "\n\nNew #{kind}:\n\n" output += added.map{|n| n[:md]}.join("\n").gsub(/^/, '- ') end if modified.length.positive? - output += "\n\nUpdated Tutorials:\n\n" + output += "\n\nUpdated #{kind}:\n\n" output += modified.map{|n| n[:md]}.join("\n").gsub(/^/, '- ') end output @@ -162,7 +162,8 @@ def build_news(data, filter: nil) o = format_tutorials( data[:added][:slides].select{|n| filter.nil? || n[:path] =~ /topics\/#{filter}/ }, - data[:modified][:slides].select{|n| filter.nil? || n[:path] =~ /topics\/#{filter}/ } + data[:modified][:slides].select{|n| filter.nil? || n[:path] =~ /topics\/#{filter}/ }, + kind: "slides" ) output += o newsworthy = newsworthy | o.length.positive?