diff --git a/.github/workflows/monthly-release.yml b/.github/workflows/monthly-release.yml index 0ca97a762feee7..83ae951d604549 100644 --- a/.github/workflows/monthly-release.yml +++ b/.github/workflows/monthly-release.yml @@ -53,7 +53,7 @@ jobs: ${{ runner.os }}-gems- - name: Install dependencies run: | - sudo apt-get install -y build-essential libxi-dev libglu1-mesa-dev libglew-dev pkg-config # for node + sudo apt-get install -y build-essential libxi-dev libglu1-mesa-dev libglew-dev pkg-config pandoc # for node, release notes gem install bundler pip install pyyaml bundle config path vendor/bundle @@ -103,4 +103,9 @@ jobs: RELEASE_TAG: ${{ env.release_tag }} RELEASE_TITLE: ${{ env.release_title }} run: | - gh release create "$RELEASE_TAG" --title "Release $RELEASE_TITLE" --notes "Monthly release of the GTN materials is now [available on the archive](https://training.galaxyproject.org/archive/$RELEASE_TAG/)." --target main --latest + # Compile release notes + echo "Monthly release of the GTN materials is now [available on the archive](https://training.galaxyproject.org/archive/$RELEASE_TAG/)." > /tmp/last-month-on.md + echo >> /tmp/last-month-on.md + bundle exec ruby bin/last-month-on.rb | pandoc --wrap none -t markdown -f html >> /tmp/last-month-on.md + # Create the release + gh release create "$RELEASE_TAG" --title "Release $RELEASE_TITLE" --notes-file /tmp/last-month-on.md --target main --latest diff --git a/_layouts/recordings.html b/_layouts/recordings.html index c1b7c239ec0522..add9e933be8454 100644 --- a/_layouts/recordings.html +++ b/_layouts/recordings.html @@ -17,7 +17,7 @@

Recordings - {{ material.title }}

Want to add your own recording? We would love to have it to our library!

- Add your recordings! + Add your Recording! diff --git a/_plugins/feeds.rb b/_plugins/feeds.rb index d6af4838f0f654..1c960301a89b99 100644 --- a/_plugins/feeds.rb +++ b/_plugins/feeds.rb @@ -16,8 +16,10 @@ def to_euro_lunch PRIO = [ 'news', 'events', + 'learning-pathways', 'tutorials', 'slides', + 'recordings', 'faqs', 'workflows', 'contributors', @@ -25,6 +27,16 @@ def to_euro_lunch 'organisations' ].map.with_index { |x, i| [x, i] }.to_h +def track(url) + if url =~ /utm_source/ + url + elsif url.include? '#' + url.gsub(/#/, TRACKING + '#') + else + url + TRACKING + end +end + def objectify(attrs, url, path) obj = attrs.clone obj['__path'] = path @@ -96,6 +108,8 @@ def markdownify(site, text) 'news' => '📰', 'faqs' => '❓', 'workflows' => '🛠️', + 'learning-pathways' => '🛤️', + 'recordings' => '🎥', } def generate_opml(site, groups) @@ -146,7 +160,7 @@ def generate_topic_feeds(site, topic, bucket) mats.each do |time, group, page, tags| xml.entry do - xml.title(ICON_FOR[group] + " " +page.data['title']) + xml.title(ICON_FOR[group] + " " + page.data['title']) link = "#{site.config['url']}#{site.baseurl}#{page.url}" xml.link(href: link) # Our links are (mostly) stable @@ -206,6 +220,7 @@ def all_date_sorted_materials(site) materials = TopicFilter.list_all_materials(site).reject { |k, _v| k['draft'] } news = site.posts.select { |x| x['layout'] == 'news' } faqs = site.pages.select { |x| x['layout'] == 'faq' } + pathways = site.pages.select { |x| x['layout'] == 'learning-pathway' } workflows = Dir.glob('topics/**/*.ga') bucket = events.map do |e| @@ -214,12 +229,35 @@ def all_date_sorted_materials(site) materials.each do |m| tags = [m['topic_name']] + (m['tags'] || []) - bucket += m.fetch('ref_tutorials', []).map do |t| - [Gtn::PublicationTimes.obtain_time(t.path).to_datetime, 'tutorials', t, tags] + m.fetch('ref_tutorials', []).map do |t| + bucket << [Gtn::PublicationTimes.obtain_time(t.path).to_datetime, 'tutorials', t, tags] + + (t['recordings'] || []).map do |r| + url = '/' + t.path.gsub(/tutorial(_[A_Z_]*)?.(html|md)$/, 'recordings/') + url += "#tutorial-recording-#{Date.parse(r['date']).strftime('%-d-%B-%Y').downcase}" + attr = {'title' => "Recording of " + t['title'], + 'contributors' => r['speakers'] + (r['captions'] || []), + 'content' => "A #{r['length']} long recording is now available."} + + obj = objectify(attr, url, t.path) + bucket << [DateTime.parse(r['date'].to_s), 'recordings', obj, tags] + end end - bucket += m.fetch('ref_slides', []).reject { |s| s.url =~ /-plain.html/ }.map do |s| - [Gtn::PublicationTimes.obtain_time(s.path).to_datetime, 'slides', s, tags] + + + m.fetch('ref_slides', []).reject { |s| s.url =~ /-plain.html/ }.map do |s| + bucket << [Gtn::PublicationTimes.obtain_time(s.path).to_datetime, 'slides', s, tags] + + (s['recordings'] || []).map do |r| + url = '/' + s.path.gsub(/slides(_[A_Z_]*)?.(html|md)$/, 'recordings/') + url += "#tutorial-recording-#{Date.parse(r['date']).strftime('%-d-%B-%Y').downcase}" + attr = {'title' => "Recording of " + s['title'], + 'contributors' => r['speakers'] + (r['captions'] || []), + 'content' => "A #{r['length']} long recording is now available."} + obj = objectify(attr, url, s.path) + bucket << [DateTime.parse(r['date'].to_s), 'recordings', obj, tags] + end end end @@ -232,6 +270,11 @@ def all_date_sorted_materials(site) [Gtn::PublicationTimes.obtain_time(n.path).to_datetime, 'faqs', n, ['faqs', tag]] end + bucket += pathways.map do |n| + tags = ['learning-pathway'] + (n['tags'] || []) + [Gtn::PublicationTimes.obtain_time(n.path).to_datetime, 'learning-pathways', n, tags] + end + bucket += workflows.map do |n| tag = Gtn::PublicationTimes.clean_path(n).split('/')[1] wf_data = JSON.parse(File.read(n)) @@ -241,7 +284,6 @@ def all_date_sorted_materials(site) 'description' => wf_data['annotation'], 'tags' => wf_data['tags'], 'contributors' => wf_data.fetch('creator', []).map do |c| - p ">> #{c}" matched = site.data['contributors'].select{|k, v| v.fetch('orcid', "does-not-exist") == c.fetch('identifier', "").gsub('https://orcid.org/', '') }.first @@ -297,6 +339,7 @@ def all_date_sorted_materials(site) bucket .reject{|x| x[0] > DateTime.now } # Remove future-dated materials + .reject{|x| x[2]['draft'] == true } # Remove drafts .sort_by {|x| x[0] } # Date-sorted, not strictly necessary since will be grouped. .reverse end @@ -407,7 +450,7 @@ def generate_matrix_feed_itemized(site, mats, group_by: 'day', filter_by: nil) href = "#{site.config['url']}#{site.config['baseurl']}#{page.url}" xml.id(href) - xml.link(href: href + TRACKING) + xml.link(href: track(href)) tags.uniq.each do |tag| xml.category(term: tag) @@ -423,7 +466,7 @@ def generate_matrix_feed_itemized(site, mats, group_by: 'day', filter_by: nil) xml.summary(text) end - prefix = type.gsub(/s$/, '').capitalize.gsub(/Faq/, 'FAQ').gsub(/New$/, 'Post') + prefix = type.gsub(/s$/, '').gsub(/-/, ' ').capitalize.gsub(/Faq/, 'FAQ').gsub(/New$/, 'Post') title = "#{ICON_FOR[type]} New #{prefix}: #{page.data['title']}" xml.title(title) @@ -527,7 +570,7 @@ def generate_matrix_feed(site, mats, group_by: 'day', filter_by: nil) xml.id("#{site.config['url']}#{site.baseurl}/#{path}") title_parts = [filter_title, "#{lookup[group_by]} Updates"].compact xml.title(title_parts.join(' — ')) - xml.subtitle('The latest events, tutorials, slides, blog posts, FAQs, workflows, and contributors in the GTN.') + xml.subtitle('The latest events, tutorials, slides, blog posts, FAQs, workflows, learning paths, recordings, and contributors in the GTN.') xml.logo("#{site.config['url']}#{site.baseurl}/assets/images/GTN-60px.png") bucket.each do |date, parts| @@ -554,17 +597,17 @@ def generate_matrix_feed(site, mats, group_by: 'day', filter_by: nil) # xml.h4 title parts.group_by { |x| x[1] }.sort_by { |x| PRIO[x[0]] }.each do |type, items| - xml.h4 "#{ICON_FOR[type]} #{type.capitalize}" + xml.h4 "#{ICON_FOR[type]} #{type.gsub(/-/, ' ').capitalize}" if items.length.positive? xml.ul do items.each do |date, _type, page, _tags| xml.li do if page.is_a?(String) - href = "#{site.config['url']}#{site.config['baseurl']}/hall-of-fame/#{page}/#{TRACKING}" + href = track("#{site.config['url']}#{site.config['baseurl']}/hall-of-fame/#{page}/") text = "@#{page}" else text = page.data['title'] - href = "#{site.config['url']}#{site.config['baseurl']}#{page.url}#{TRACKING}" + href = track("#{site.config['url']}#{site.config['baseurl']}#{page.url}") end if group_by != 'day' text += " (#{date.strftime('%B %d, %Y')})" diff --git a/_plugins/jekyll-jsonld.rb b/_plugins/jekyll-jsonld.rb index de8324818ec3c1..783d8229cfdb90 100644 --- a/_plugins/jekyll-jsonld.rb +++ b/_plugins/jekyll-jsonld.rb @@ -691,11 +691,18 @@ def generate_material_jsonld(material, topic, site) # "award":, # "author" described below # "character":, - citation: { - '@type': 'CreativeWork', - name: 'Community-Driven Data Analysis Training for Biology', - url: 'https://doi.org/10.1016/j.cels.2018.05.012' - }, + citation: [ + { + '@type': 'CreativeWork', + name: 'Galaxy Training: A Powerful Framework for Teaching!', + url: 'https://doi.org/10.1371/journal.pcbi.1010752' + }, + { + '@type': 'CreativeWork', + name: 'Community-Driven Data Analysis Training for Biology', + url: 'https://doi.org/10.1016/j.cels.2018.05.012' + } + ], # "comment":, # "commentCount":, # "contentLocation":, diff --git a/_plugins/sitemap.rb b/_plugins/sitemap.rb index c254487073abe2..010cfa28a50e39 100644 --- a/_plugins/sitemap.rb +++ b/_plugins/sitemap.rb @@ -33,7 +33,12 @@ def _build(site) 'http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" ' \ 'xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' - site.pages.reject { |t| t.path =~ /ipynb$/ || t.path =~ /api\/ga4gh\/trs\/v2/}.each do |t| + subset_pages = site.pages + .reject { |t| t.path =~ /ipynb$/ || t.path =~ /api\/ga4gh\/trs\/v2/} + .reject { |t| t.data.fetch('layout', 'page') =~ /external/} + .reject { |t| t.data.fetch('hands_on', '') == 'external'} + + subset_pages.each do |t| begin d = Gtn::ModificationTimes.obtain_time(t.path) d.format = '%FT%T%:z' diff --git a/_plugins_dev/sitemap-fake.rb b/_plugins_dev/sitemap-fake.rb index 971ce8f211d852..063e3edfb5042e 100644 --- a/_plugins_dev/sitemap-fake.rb +++ b/_plugins_dev/sitemap-fake.rb @@ -1,6 +1,6 @@ module Jekyll # Fake sitemap generator. - class SitemapGenerator < Generator + class SitemapGenerator2 < Generator safe true def generate(site) @@ -11,7 +11,13 @@ def generate(site) 'http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" ' \ 'xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' - site.pages.each do |t| + + subset_pages = site.pages + .reject { |t| t.path =~ /ipynb$/ || t.path =~ /api\/ga4gh\/trs\/v2/} + .reject { |t| t.data.fetch('layout', 'page') =~ /external/} + .reject { |t| t.data.fetch('hands_on', '') == 'external'} + + subset_pages.each do |t| result += "#{site.config['url'] + site.config['baseurl'] + t.url}" \ '2016-06-30T18:00:00-07:00' end diff --git a/bin/last-month-on.rb b/bin/last-month-on.rb new file mode 100644 index 00000000000000..4a6eeb903ae53a --- /dev/null +++ b/bin/last-month-on.rb @@ -0,0 +1,7 @@ +require 'nokogiri' + +data = File.read('_site/training-material/feeds/matrix-month.xml') +doc = Nokogiri::XML(data) +res = doc.css('entry content')[0].children[1].children.to_s +res.gsub!(/utm_source=matrix.*utm_campaign=matrix-news/, 'utm_source=github&utm_medium=release&utm_campaign=release-notes') +puts res diff --git a/faqs/gtn/recordings_add.md b/faqs/gtn/recordings_add.md index 7e48b798e5aff7..bfee442b7e7761 100644 --- a/faqs/gtn/recordings_add.md +++ b/faqs/gtn/recordings_add.md @@ -8,7 +8,7 @@ contributors: [shiltemann] **We welcome anybody to submit their recordings!** Your videos can be used in (online) training events, or for self-study by learners on the GTN. -For some tips and tricks about recording the video itself, please see +For some tips and tricks about recording the video itself, please ensure your recording conforms to our recommendations: [Recording Tips & Tricks]({% link faqs/gtn/recordings_create.md %}){: .btn.btn-info} [Submit a Recording](https://forms.gle/qNG8FkTN1yRZPNZY6){: .btn.btn-info} diff --git a/learning-pathways/beyond_single_cell.md b/learning-pathways/beyond_single_cell.md index 613cd7561d74e7..febbcd4eed527e 100644 --- a/learning-pathways/beyond_single_cell.md +++ b/learning-pathways/beyond_single_cell.md @@ -1,6 +1,6 @@ --- layout: learning-pathway -tags: [intermediate] +tags: [intermediate, single-cell] cover-image: assets/images/wab-annotatedcells-2.png cover-image-alt: "Image of cells in different coloured clusters" type: use diff --git a/learning-pathways/intro_single_cell.md b/learning-pathways/intro_single_cell.md index bfecc1f3697678..56795949ce9c35 100644 --- a/learning-pathways/intro_single_cell.md +++ b/learning-pathways/intro_single_cell.md @@ -1,6 +1,6 @@ --- layout: learning-pathway -tags: [beginner] +tags: [beginner, single-cell] cover-image: assets/images/wab-annotatedcells-2.png cover-image-alt: "Image of cells in different coloured clusters" type: use