Skip to content

Commit

Permalink
Merge pull request #4402 from galaxyproject/scylla-octatonic
Browse files Browse the repository at this point in the history
fix news again
  • Loading branch information
hexylena authored Oct 11, 2023
2 parents 2f15950 + 36e56a4 commit c9e1e93
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions bin/news.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand All @@ -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?
Expand Down

0 comments on commit c9e1e93

Please sign in to comment.