-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathcontent_filelinks.html
More file actions
41 lines (40 loc) · 4.86 KB
/
content_filelinks.html
File metadata and controls
41 lines (40 loc) · 4.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
{% include content_path.liquid content=include.content %}
<div class="content_links">
{% assign value = include.content.base_value %}{% if include.content.status=="featured" %}{% assign value = value | times: site.data.ga.featured_value_multiplier %}{% endif %}
{% if include.content.external_url %}
<a class="btn" {% if include.newtab %}target="_blank"{% endif %} data-content-path="{{ content_path }}" ga-event-value="{{ value }}" href="{{ include.content.external_url }}"{% for nrh in site.data.content.noreferrerhosts %}{% if include.content.external_url contains nrh %} rel="noreferrer"{% break %}{% endif %}{% endfor %}><i class="fa{% if include.content.external_url contains "youtu" %}b fa-youtube"></i> YouTube{% elsif include.content.external_url contains "//www.academia.edu/" %}c-academia"></i>cademia.edu{% else %}s fa-{% assign ext = include.content.external_url | slice: -4, 4 %}{% if ext == ".pdf" %}file-pdf"></i> pdf{% elsif ext == ".mp3" %}file-audio"></i> mp3{% elsif ext == ".zip" %}file-archive"></i> zip{% else %}{% case include.content.category %}{% when "av" %}volume-up{% when "booklets" %}book-open{% when "monographs" %}book-open{% else %}globe{% endcase %}"></i> Online{% endif %}{% endif %}</a>
{% endif %}
{% if include.content.file_links.size > 0 %}
{%- for link in include.content.file_links -%}
{% assign i = forloop.index | minus: 1 %}
<a class="btn" {% if include.newtab %}target="_blank"{% endif %} ga-event-value="{{ value }}" data-content-path="{{ content_path }}" ga-event-label="{{ link }}" href={{ site.data.content.filehost | append: link }}><i class="fa{% case include.content.formats[i] %}{% when "pdf" %}r fa-file-pdf{% when "jpeg" %}r fa-file-image{% when "mp3" %}r fa-file-audio{% when "m4a" %}r fa-file-audio{% when "epub" %}s fa-tablet-alt{% when "png" %}r fa-file-image{% when "mp3s" %}r fa-file-open{% when "zip" %}r fa-file-archive{% when "pdfs" %}r fa-file-open{% when "wma" %}r fa-file-audio{% else %}r fa-file{% endcase %}"></i> {{ include.content.formats[i] }}</a>
{%- endfor -%}
{%- endif -%}
{%- if include.content.drive_links.size > 0 -%}
{%- for link in include.content.drive_links -%}
{% assign i = forloop.index | minus: 1 %}
<a class="btn" {% if include.newtab %}target="_blank"{% endif %} ga-event-value="{{ value }}" data-content-path="{{ content_path }}" ga-event-label="drive.google.com/{{ content_path }}.{{ include.content.formats[i] }}" href="{{ link }}"><i class="fa{% if link contains "drive.google.com" %}b fa-google-drive{% elsif link contains "play.google.com" %}b fa-google-play{% else %}s fa-globe{% endif %}"></i> {{ include.content.formats[i] }}</a>
{%- endfor -%}
{%- endif -%}
{% if page.source_url %}
<a class="btn" href="{{ include.content.source_url }}" {% if include.newtab %}target="_blank"{% endif %} data-content-path="{{ content_path }}" ga-event-value="{{ value }}"><i class="fas fa-route"></i> Origin</a>
{% endif %}
{%- assign showworldcat = false -%}
{%- unless include.content.source_url or include.content.external_url or include.content.file_links or include.content.drive_links.size > 0 or include.newtab -%}
{%- assign showworldcat = true -%}
{%- endunless -%}
{%- if include.content.excerpt_url -%}
{%- if showworldcat -%}<details class="copyright details-reset"><summary>{%- endif -%}
<a class="btn" {% if include.newtab %}target="_blank" {% endif %}href="{{ include.content.excerpt_url }}" ga-event-value="{{ value | divided_by: 2 }}" data-content-path="{{ content_path }}" ga-event-label="{{ include.content.excerpt_url }}"><i class="fas fa-book-reader"></i> Preview</a>
{%- endif -%}
{%- if showworldcat -%}
{%- unless include.content.excerpt_url -%}<details class="copyright details-reset"><summary>{%- endunless -%}
{%- capture authors -%}{% include content_authors_string.html content=include.content %}{%- endcapture -%}
{% assign authors = authors | strip_html | strip | cgi_escape %}
<a class="btn" href="https://www.worldcat.org/{% if include.content.oclc %}oclc/{{ include.content.oclc }}{% else %}search?q=ti%3A{{ include.content.title | markdownify | strip_html | strip | cgi_escape }}{% if authors %}+au%3A{{ authors }}{% endif %}{% if include.content.category == 'monographs' %}&fq=x0%3Abook+%3E+ln%3Aeng{% endif %}&qt=advanced{% endif %}"><i class="fas fa-binoculars"></i> WorldCat™</a>
<i class="far fa-question-circle"></i>
</summary><div>
<i class="far fa-copyright"></i> This fine, Copyrighted work cannot be shared {% if include.content.excerpt_url %}in its entirety{% else %}directly{% endif %}, however WorldCat™ can help you find a copy at a nearby library{% if include.content.category == 'monographs' %} or wherever you get books{% endif %}.
</div></details>
{%- endif -%}
</div>