diff --git a/FUNDERS.yaml b/FUNDERS.yaml index 4e8fcfee6927c0..9e6508f9a5d237 100644 --- a/FUNDERS.yaml +++ b/FUNDERS.yaml @@ -45,6 +45,7 @@ CINECA-Project: funder: true funding_id: "825775" funding_system: cordis + funder_name: Horizon 2020 url: https://www.cineca-project.eu epsrc-training-grant: diff --git a/_layouts/base.html b/_layouts/base.html index 3ba7a5408f3cd6..5539928a4e9e78 100644 --- a/_layouts/base.html +++ b/_layouts/base.html @@ -22,7 +22,6 @@ - {{ page | generate_dublin_core: site }} {% assign topic = site.data[page.topic_name] %} diff --git a/_layouts/faq.html b/_layouts/faq.html index 8c6484b7733ddc..1f38a2af74b499 100644 --- a/_layouts/faq.html +++ b/_layouts/faq.html @@ -1,9 +1,9 @@ --- layout: base --- - +
{% assign contributors = site.data['contributors'] %} -
+
- -

{{page.title}}

+

{{page.title}}

{% if page.contributors %}
{{ locale['authors'] | default: "Authors" }}: {% include @@ -48,8 +47,8 @@

{{page.title}}

{% endif %}
-
-
+
+
{{ page.description }} @@ -85,3 +84,4 @@

{{locale['references']| default: "References" }}

{% endif %}
+
diff --git a/_layouts/learning-pathway.html b/_layouts/learning-pathway.html index e33ac8d95dbfd3..d9607284513274 100644 --- a/_layouts/learning-pathway.html +++ b/_layouts/learning-pathway.html @@ -11,6 +11,24 @@ {% assign gitter = site.gitter_url %} {% endif %} + + +
diff --git a/_plugins/gtn/boxify.rb b/_plugins/gtn/boxify.rb index dd0d117ea24109..53d8d0466e8934 100644 --- a/_plugins/gtn/boxify.rb +++ b/_plugins/gtn/boxify.rb @@ -155,7 +155,7 @@ def self.generate_collapsible_title(box_type, title, lang = 'en', key, contents: [box_id, %(
diff --git a/_plugins/gtn/contributors.rb b/_plugins/gtn/contributors.rb index 994ae3298dd42d..922489fdb2f8d1 100644 --- a/_plugins/gtn/contributors.rb +++ b/_plugins/gtn/contributors.rb @@ -38,6 +38,25 @@ def self.get_authors(data) end end + ## + # Get the non-author contributors of a material. + # Params: + # +data+:: +Hash+ of the YAML frontmatter from a material + # Returns: + # +Array+ of contributor IDs + def self.get_non_authors(material) + if material.key?('contributors') + [] + elsif material.key?('contributions') + material['contributions'] + .reject { |k| k == 'funding' } + .reject { |k| k == 'authorship' } + .values.flatten.uniq + else + [] + end + end + # Convenience method to allow us to handle nil sites, and load directly # from disk ourselves. def self._load_file(site, category) diff --git a/_plugins/jekyll-jsonld.rb b/_plugins/jekyll-jsonld.rb index ebd27ac43e8cb8..1deab2f81706fe 100644 --- a/_plugins/jekyll-jsonld.rb +++ b/_plugins/jekyll-jsonld.rb @@ -10,7 +10,8 @@ module JsonldFilter '@type': 'Organization', email: 'galaxytrainingnetwork@gmail.com', name: 'Galaxy Training Network', - url: 'https://galaxyproject.org/teach/gtn/' + url: 'https://training.galaxyproject.org', + logo: 'https://training.galaxyproject.org/training-material/assets/images/GTNLogo1000.png', }.freeze A11Y = { @@ -25,6 +26,14 @@ module JsonldFilter 'for non-visual users.', }.freeze + EDU_ROLES = { + 'use' => 'Students', + 'admin-dev' => 'Galaxy Administrators', + 'basics' => 'Students', + 'data-science' => 'Data-Science Students', + 'instructors' => 'Instructors', + } + ## # Generate the Dublin Core metadata for a material. # Parmaeters: @@ -131,21 +140,36 @@ def generate_org_jsonld(id, contributor, site) end def generate_funder_jsonld(id, contributor, site) - organization = { - '@context': 'https://schema.org', - '@type': 'Grant', - identifier: contributor['funding_id'], - url: contributor['url'] || Gtn::Contributors.fetch_funding_url(contributor), - funder: { + organization = [ + { + '@context': 'https://schema.org', '@type': 'Organization', + 'http://purl.org/dc/terms/conformsTo': { + '@id': 'https://bioschemas.org/profiles/Organization/0.3-DRAFT', + '@type': 'CreativeWork' + }, name: Gtn::Contributors.fetch_name(site, id), - description: contributor.fetch('funding_statement', - 'An organization supporting the Galaxy Training Network'), - url: Gtn::Contributors.fetch_funding_url(contributor), + description: contributor.fetch('funding_statement', 'An organization supporting the Galaxy Training Network'), + url: contributor.fetch('url', "https://training.galaxyproject.org/training-material/hall-of-fame/#{id}/"), + logo: contributor.fetch('avatar', "https://github.com/#{id}.png"), + }, + { + '@context': 'https://schema.org', + '@type': 'Grant', + identifier: contributor['funding_id'], + url: contributor['url'] || Gtn::Contributors.fetch_funding_url(contributor), + funder: { + '@type': 'Organization', + name: contributor['funder_name'], + description: contributor.fetch('funding_statement', + 'An organization supporting the Galaxy Training Network'), + url: Gtn::Contributors.fetch_funding_url(contributor), + } } - } - organization['startDate'] = contributor['start_date'] if contributor.key?('start_date') - organization['endDate'] = contributor['end_date'] if contributor.key?('end_date') + ] + + organization[1]['startDate'] = contributor['start_date'] if contributor.key?('start_date') + organization[1]['endDate'] = contributor['end_date'] if contributor.key?('end_date') organization end @@ -260,7 +284,7 @@ def to_jsonld(material, topic, site) # "associatedMedia":, audience: { '@type': 'EducationalAudience', - educationalRole: 'Students' + educationalRole: EDU_ROLES[topic['type']] }, # "audio":, # "award":, @@ -344,7 +368,6 @@ def to_jsonld(material, topic, site) # "alternateName":, # "description" described below # "disambiguatingDescription":, - identifier: site['github_repository'], # "image":, # "mainEntityOfPage":, # "name" described below @@ -353,8 +376,11 @@ def to_jsonld(material, topic, site) # "subjectOf":, # "url" described below workTranslation: [], - creativeWorkStatus: material['draft'] ? 'Under development' : 'Active', + creativeWorkStatus: material['draft'] ? 'Draft' : 'Active', } + + data['identifier'] = "https://gxy.io/GTN:#{material['short_id']}" if material.key?('short_id') + data.update(A11Y) # info depending if tutorial, hands-on or slide level @@ -367,15 +393,17 @@ def to_jsonld(material, topic, site) data['isPartOf'] = topic_desc if (material['name'] == 'tutorial.md') || (material['name'] == 'slides.html') - if material['name'] == 'tutorial.md' - data['learningResourceType'] = 'hands-on tutorial' - data['name'] = "Hands-on for '#{material['title']}' tutorial" - else - data['learningResourceType'] = 'slides' - data['name'] = "Slides for '#{material['title']}' tutorial" - end + data['learningResourceType'] = if material['name'] == 'tutorial.md' + 'hands-on tutorial' + else + 'slides' + end + data['name'] = material['title'] data['url'] = "#{site['url']}#{site['baseurl']}#{material['url']}" + # Requires https://github.com/galaxyproject/training-material/pull/4271 + data['version'] = Gtn::ModificationTimes.obtain_modification_count(material['path']) + # Time required if material.key?('time_estimation') && !material['time_estimation'].nil? data['timeRequired'] = "PT#{material['time_estimation'].upcase}" @@ -397,8 +425,7 @@ def to_jsonld(material, topic, site) end # Keywords - data['keywords'] = [topic['name']] + (material['tags'] || []) - data['keywords'] = data['keywords'].join(', ') + data['keywords'] = [topic['title']] + (material['tags'] || []) # Zenodo links if material.key?('zenodo_link') mentions.push({ @@ -517,6 +544,13 @@ def to_jsonld(material, topic, site) data['author'] = authors end + # Add non-author contributors + if material.key?('contributions') + data['contributor'] = Gtn::Contributors.get_non_authors(material).map do |x| + generate_person_jsonld(x, site['data']['contributors'][x], site) + end + end + about = [] about.push(topic_desc) edam_terms = topic.fetch('edam_ontology', []) | material.fetch('edam_ontology', []) diff --git a/bin/workflows-fetch.rb b/bin/workflows-fetch.rb index 884a5b97dd2ee1..369175008e415a 100755 --- a/bin/workflows-fetch.rb +++ b/bin/workflows-fetch.rb @@ -15,9 +15,13 @@ def fetch_workflows(server) http.request(request) end - JSON.parse(response.body).map do |w| - w['server'] = server - w + begin + JSON.parse(response.body).map do |w| + w['server'] = server + w + end + rescue StandardError + [] end end