Skip to content

Commit bdbd3de

Browse files
committed
Dont disp img on yt vids
1 parent 8f18b8f commit bdbd3de

3 files changed

Lines changed: 5 additions & 2 deletions

File tree

‎_includes/content_filelinks.html‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div class="content_links">{% if page.collection == "content" and page.external_url %}{% if page.external_url contains "archive.org" and page.category == "monographs" and page.external_url contains "/mode/" %}Read it:{% elsif page.subcat == "podcast" %}Listen:{% elsif page.subcat == "film" or page.subcat == "course" and page.external_url contains "youtu" %}Watch:{% else %}Get it:{% endif %}{% elsif page.collection == "content" and page.drive_links.size > 0 %}Available as:{% endif %}
22
{% if include.content.external_url %}{% assign linkfmt = "" %}
3-
{%- capture linkbody -%}<i class="fa{% if include.content.external_url contains "youtu" %}{% assign linkfmt = "YouTube (link)" %}b fa-youtube"></i> YouTube{% elsif include.content.external_url contains "//www.academia.edu/" %}c-academia"></i>cademia.edu{% assign linkfmt = "Academia.edu" %}{% else %}s fa-{% assign ext = include.content.external_url | slice: -4, 4 %}{% if ext == ".mp3" %}{% assign linkfmt = "mp3" %}file-audio"></i> mp3{% elsif ext == ".zip" %}{% assign linkfmt = "zip" %}file-archive"></i> zip{% elsif ext == ".htm" or ext == "html" %}{% assign linkfmt = "html" %}globe"></i> Online{% elsif include.content.external_url contains "download" or include.content.external_url contains "viewcontent.cgi" or include.content.external_url contains "pdf" %}{% assign linkfmt = "pdf" %}file-pdf"></i> pdf{% else %}{% case include.content.category %}{% when "av" %}volume-up{% when "booklets" %}book-open{% when "monographs" %}book-open{% else %}globe{% endcase %}"></i> Online{% endif %}{% endif %}{%- endcapture -%}
3+
{%- capture linkbody -%}<i class="fa{% if include.content.external_url contains "youtu" %}{% assign linkfmt = "YouTube (link)" %}b fa-youtube"></i> YouTube{% elsif include.content.external_url contains "//www.academia.edu/" %}c-academia"></i>cademia.edu{% assign linkfmt = "Academia.edu" %}{% else %}s fa-{% assign ext = include.content.external_url | slice: -4, 4 %}{% if ext == ".mp3" %}{% assign linkfmt = "mp3" %}file-audio"></i> mp3{% elsif ext == ".zip" %}{% assign linkfmt = "zip" %}file-archive"></i> zip{% elsif ext == ".htm" or ext == "html" %}{% assign linkfmt = "html" %}globe"></i> Online{% elsif include.content.external_url contains "download" or include.content.external_url contains "viewcontent.cgi" or include.content.external_url contains "pdf" %}{% assign linkfmt = "pdf" %}file-pdf"></i> pdf{% else %}{% case include.content.category %}{% when "av" %}{% if page.subcat == "film" %}video{% else %}volume-up{% endif %}{% when "booklets" %}book-open{% when "monographs" %}book-open{% else %}globe{% endcase %}"></i> Online{% endif %}{% endif %}{%- endcapture -%}
44
<a class="btn" {% if include.newtab %}target="_blank"{% endif %} {% include content_link_data_attributes.html content=include.content linktype="Main External URL" linkfmt=linkfmt %} href="{{ include.content.external_url }}"{% for nrh in site.data.content.noreferrerhosts %}{% if include.content.external_url contains nrh %} rel="noreferrer"{% break %}{% endif %}{% endfor %}>{{ linkbody }}</a>
55
{% endif %}
66
{%- if include.content.drive_links.size > 0 -%}

‎_layouts/content.html‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@
2323
<header class="post-header">
2424
<script>window.topic_category="{{ page.course | default: 'archive' }}";</script>
2525
<div class="back"><a href="/content/">Content</a> / <a href="/content/{{ page.category }}/">{{ category.title }}</a> /</div>
26-
{% if page.olid %}
26+
{%- if page.category == "av" and page.external_url contains "youtu" -%}
27+
{%- comment -%}Don't add an img on top if there will be a YouTube player below{%- endcomment -%}
28+
{%- elsif page.olid -%}
2729
<img src="https://buddhistuniversity.net/assets/imgs/covers/{{ page.olid }}.jpg" alt="the book cover">
2830
{% elsif page.image %}
2931
<img src="{{page.image}}">

‎_plugins/addicontips.rb‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ module IconTipFilter
1313
{c: 'fas fa-book-open', n: 'open book', t: 'piece', d: 'is a self-published, open-access book(let)'},
1414
{c: 'fas fa-music', n: 'pair of eighth-notes', t: 'piece', d: 'is musical'},
1515
{c: 'fas fa-film', n: 'film strip', t: 'piece', d: 'is meant to be watched'},
16+
{c: 'fas fa-video', n: 'projector', t: 'link', d: 'takes you to a video'},
1617
{c: 'fas fa-podcast', n: 'radio antenna', t: 'piece', d: 'can be found on any podcast app'},
1718
{c: 'fas fa-graduation-cap', n: 'graduation cap', t: 'piece', d: 'is an unedited, academic thesis'},
1819
{c: 'far fa-pen-to-square', n: 'pencil in a square', t: 'piece', d: 'is a comic'},

0 commit comments

Comments
 (0)