Skip to content

Commit

Permalink
Scrap more code due to intro slides
Browse files Browse the repository at this point in the history
  • Loading branch information
hexylena committed Jan 20, 2023
1 parent 86ca0ae commit 88a15df
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 33 deletions.
16 changes: 6 additions & 10 deletions _includes/resource-slides.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
{% if include.material.type == 'introduction' %}
{% assign subfolder = 'slides' %}
{% else %}
{% assign subfolder = 'tutorials' %}
{% endif %}
{% assign subfolder = 'tutorials' %}

{% if include.material.slides %}
<span class="btn-group">
<a class="visually-hidden" href="{{ site.baseurl }}/topics/{{ include.material.topic_name }}/{{subfolder}}{% unless include.material.type == 'introduction' %}/{{ include.material.tutorial_name }}{% endunless %}/slides-plain.html" aria-label="more accessible, plain text slides">plain text</a>
<a class="visually-hidden" href="{{ site.baseurl }}/topics/{{ include.material.topic_name }}/{{subfolder}}/{{ include.material.tutorial_name }}/slides-plain.html" aria-label="more accessible, plain text slides">plain text</a>
<span class="btn-group">
<a class="btn btn-default topic-icon" href="{{ site.baseurl }}/topics/{{ include.material.topic_name }}/{{subfolder}}/{{ include.material.tutorial_name }}{% unless include.material.type == 'introduction' %}/slides{% endunless %}.html" title="Slides">
<a class="btn btn-default topic-icon" href="{{ site.baseurl }}/topics/{{ include.material.topic_name }}/{{subfolder}}/{{ include.material.tutorial_name }}/slides.html" title="Slides">
{% icon slides aria=false %}
</a>
<a href="#" class="btn btn-default dropdown-toggle dropdown-toggle-split" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" title="View slides in different languages">
Expand All @@ -28,15 +24,15 @@

<div class="dropdown-item"><strong>Automatic translations</strong></div>
{% for lang in language %}{% unless lang[0] == 'en' %}
<a class="dropdown-item" href="https://translate.google.com/translate?hl=jp&sl=en&tl={{ lang[0] }}&u=https%3A%2F%2Ftraining.galaxyproject.org%2Ftopics%2F{{ include.material.topic_name }}%2F{{subfolder}}%2F{{ include.material.tutorial_name }}{% unless include.material.type == 'introduction' %}%2Fslides{% endunless %}.html&edit-text=&act=url" title="{{ inst[0] }}">
<a class="dropdown-item" href="https://translate.google.com/translate?hl=jp&sl=en&tl={{ lang[0] }}&u=https%3A%2F%2Ftraining.galaxyproject.org%2Ftopics%2F{{ include.material.topic_name }}%2F{{subfolder}}%2F{{ include.material.tutorial_name }}%2Fslides.html&edit-text=&act=url" title="{{ inst[0] }}">
{{ lang[1] }}
</a>
{% endunless %}{% endfor %}
<a class="dropdown-item" href="https://translate.google.com/translate?hl=jp&sl=en&tl=&u=https%3A%2F%2Ftraining.galaxyproject.org%2Ftopics%2F{{ include.material.topic_name }}%2F{{subfolder}}%2F{{ include.material.tutorial_name }}%2Fslides.html&edit-text=&act=url" title="{{ inst[0] }}">
More Languages
</a>

<a class="btn btn-default topic-icon" href="{{ site.baseurl }}/topics/{{ include.material.topic_name }}/{{subfolder}}/{% unless include.material.type == 'introduction' %}{{ include.material.tutorial_name }}/{% endunless %}slides-plain.html" aria-label="more accessible, plain text slides">
<a class="btn btn-default topic-icon" href="{{ site.baseurl }}/topics/{{ include.material.topic_name }}/{{subfolder}}/{{ include.material.tutorial_name }}/slides-plain.html" aria-label="more accessible, plain text slides">
{% icon text-document aria=false %} Plain text slides
</a>
</ul>
Expand All @@ -47,7 +43,7 @@
{% if include.material.video %}
<span class="btn-group">
<!-- add video button -->
<a class="btn btn-default topic-icon" href="{{ site.baseurl }}/videos/watch.html?v={{ include.material.topic_name }}/{{subfolder}}/{{ include.material.tutorial_name }}{% unless include.material.type == 'introduction' %}/slides{% endunless%}" title="Video Slides (text-to-speech)">
<a class="btn btn-default topic-icon" href="{{ site.baseurl }}/videos/watch.html?v={{ include.material.topic_name }}/{{subfolder}}/{{ include.material.tutorial_name }}/slides" title="Video Slides (text-to-speech)">
{% icon video-slides aria=false %}
</a>

Expand Down
6 changes: 0 additions & 6 deletions _includes/tutorial_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,6 @@
</div>

<div class="duplicate">
{% if material.type == "introduction" %}
{% if material.slides %}
{% include _includes/resource-slides.html material=material topic=topic.name %}
{% endif %}
{% elsif material.type == "tutorial" %}
<div class="btn-group" role="group" aria-label="Supporting materials for this resource">
{% include _includes/resource-slides.html material=material topic=topic.name %}
{% include _includes/resource-handson.html material=material topic=topic.name %}
Expand All @@ -62,7 +57,6 @@
{% include _includes/instance-dropdown.html instances=instances topic=topic.name tuto=material.tutorial_name %}
{% endif %}
</div>
{% endif %}
</div>

</td>
Expand Down
9 changes: 0 additions & 9 deletions _layouts/tutorial_hands_on.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@
{% assign associated_slides = true %}
{% endif %}
{% endif %}
{% if material.type == "introduction" %}
{% assign intro_link = true %}
{% assign intro_target = material.tutorial_name | append: '.html' %}

{% endif %}
{% endif %}
{% endfor %}

Expand Down Expand Up @@ -418,15 +413,11 @@ <h1>{{locale['citing-tutorial'] | default: "Citing this Tutorial"}}</h1>
<ol>
{% for material in topic_material %}
{% if material.enable != "false" or jekyll.environment != "production" %}
{% if material.type == "introduction" %}
<li><a href="{{ site.baseurl }}/topics/{{ topic.name }}/slides/{{ material.tutorial_name }}.html">{{ material.title }}</a></li>
{% elsif material.type == "tutorial" %}
{% if material.hands_on %}
<li><a href="{{ site.baseurl }}/topics/{{ topic.name }}/tutorials/{{ material.tutorial_name }}/tutorial.html">{{ material.title }}</a></li>
{% elsif material.slides %}
<li><a href="{{ site.baseurl }}/topics/{{ topic.name }}/tutorials/{{ material.tutorial_name }}/slides.html">{{ material.title }}</a></li>
{% endif %}
{% endif %}
{% endif %}
{% endfor %}
</ol>
Expand Down
7 changes: 1 addition & 6 deletions _plugins/jekyll-jsonld.rb
Original file line number Diff line number Diff line change
Expand Up @@ -265,12 +265,7 @@ def to_jsonld(material, topic, site)

data['isPartOf'] = topic_desc

if material['type'] == 'introduction' then
data['learningResourceType'] = "slides"
data['name'] = "Introduction to '#{topic['title']}'"
data['url'] = "#{site['url']}#{site['baseurl']}#{material['url']}"
description.push("Slides for #{topic['title']}")
elsif material['name'] == 'tutorial.md' or material['name'] == 'slides.html' then
if material['name'] == 'tutorial.md' or material['name'] == 'slides.html' then
if material['name'] == 'tutorial.md' then
data['learningResourceType'] = "hands-on tutorial"
data['name'] = "Hands-on for '#{material['title']}' tutorial"
Expand Down
4 changes: 2 additions & 2 deletions videos/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ The GTN now generates videos for selected slide decks. Click on a topic below to
<div id="playlist">
{% for material in topic_material %}
{% if material.video %}
{% capture vid %}{{ topic_id }}/{% if material.type == "introduction" %}slides/introduction{% else %}tutorials/{{ material.tutorial_name }}/slides{% endif %}{% endcapture %}
{% capture vid %}{{ topic_id }}/tutorials/{{ material.tutorial_name }}/slides{% endcapture %}
<div class="pl-item">
<a href="watch.html?v={{ vid }}">
<div class="cover">
Expand All @@ -67,7 +67,7 @@ The GTN now generates videos for selected slide decks. Click on a topic below to
</a>
</div>
{% for lang in material.translations.slides %}
{% capture vid %}{{ topic_id }}/{% if material.type == "introduction" %}slides/introduction_{{ lang | upcase }}{% else %}tutorials/{{ material.tutorial_name }}/slides_{{ lang | upcase }}{% endif %}{% endcapture %}
{% capture vid %}{{ topic_id }}/tutorials/{{ material.tutorial_name }}/slides_{{ lang | upcase }}{% endcapture %}
<div class="pl-item">
<a href="watch.html?v={{ vid }}">
<div class="cover">
Expand Down

0 comments on commit 88a15df

Please sign in to comment.