Skip to content

Commit 7e6f1b2

Browse files
committed
move smallpdfs over to cloudflare
1 parent ba8e987 commit 7e6f1b2

3 files changed

Lines changed: 12 additions & 2 deletions

File tree

‎_includes/content_filelinks.html‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
{%- for link in include.content.file_links -%}
1414
{%- assign bucket = link | split: "/" | first -%}
1515
{% assign linkfmt = include.content.formats[forloop.index0] %}
16-
<a download class="btn" {% if include.newtab %}target="_blank"{% endif %} {% include content_link_data_attributes.html content=include.content linktype="Self-Hosted" linkfmt=linkfmt %} href="{% if bucket == "largefiles" %}https://cfr-cdn.buddhistuniversity.net/{{ link | remove_first: "largefiles/" }}{% else %}{{ site.data.content.filehost | append: link }}{% endif %}"><i class="fas fa-cloud-arrow-down"></i> {{ linkfmt }}</a>
16+
<a download class="btn" {% if include.newtab %}target="_blank"{% endif %} {% include content_link_data_attributes.html content=include.content linktype="Self-Hosted" linkfmt=linkfmt %} href="{% if bucket == "smallpdfs" %}https://smallpdfs.buddhistuniversity.net/{{ link | remove_first: "smallpdfs/" }}{% elsif bucket == "largefiles" %}https://cfr-cdn.buddhistuniversity.net/{{ link | remove_first: "largefiles/" }}{% else %}{{ site.data.content.filehost | append: link }}{% endif %}"><i class="fas fa-cloud-arrow-down"></i> {{ linkfmt }}</a>
1717
{%- endfor -%}
1818
{%- endif -%}
1919
{% if page.source_url %}

‎_includes/content_title.html‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,17 @@
33
<span id="{{ c.slug }}">{% if c.external_url %}<a target="_blank" {% include content_link_data_attributes.html content=c linktype="Main External URL" linkfmt="" %} href="{{ c.external_url }}"{% for nrh in site.data.content.noreferrerhosts %}{% if c.external_url contains nrh %} rel="noreferrer"{% break %}{% endif %}{% endfor %}>{% endif %}{{ c.title | markdownify | remove: '<p>' | remove: '</p>' }}{% if c.authors.size > 0 or c.reader %} – {% include content_authors_string.html content=c %}{% endif %}{% if c.external_url %}</a>{% endif %}</span>
44
{% if c.drive_links %}<span>
55
{%- for link in c.file_links -%}
6+
{%- assign bucket = link | split: "/" | first -%}
7+
{%- case bucket -%}
8+
{%- when "largefiles" -%}
9+
{%- capture href -%}https://cfr-cdn.buddhistuniversity.net/{{ link | remove_first: "largefiles/" }}{%- endcapture -%}
10+
{%- when "smallpdfs" -%}
11+
{%- capture href -%}https://smallpdfs.buddhistuniversity.net/{{ link | remove_first: "smallpdfs/" }}{%- endcapture -%}
12+
{%- else -%}
13+
{%- assign href = site.data.content.filehost | append: link -%}
14+
{%- endcase -%}
615
{%- assign linkfmt = c.formats[forloop.index0] -%}
7-
<span class="inline_drive_link"> (<a target="_blank" {% include content_link_data_attributes.html content=c linktype="Self-Hosted" linkfmt=linkfmt %} href="{{ site.data.content.filehost | append: link }}"><i class="fa{% case linkfmt %}{% when "pdf" %}r fa-file-pdf{% 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>.{{ linkfmt }}</a>)</span>
16+
<span class="inline_drive_link"> (<a target="_blank" {% include content_link_data_attributes.html content=c linktype="Self-Hosted" linkfmt=linkfmt %} href="{{ href }}"><i class="fa{% case linkfmt %}{% when "pdf" %}r fa-file-pdf{% 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>.{{ linkfmt }}</a>)</span>
817
{%- endfor -%}
918
{%- for link in c.drive_links -%}
1019
{%- assign linkfmt = c.formats[forloop.index0] -%}

‎_includes/inline-av-player.html‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
{% endif %}
77
{%- assign title = record.title | smartify | markdownify | strip_html | strip -%}
88
{% if record.file_links[0] and record.file_links[0] != "" %}
9+
{% comment %}No need to worry about CloudFlare hosted files here yet. Update if we ever host media files on R2{% endcomment %}
910
{% assign rawfile = site.data.content.filehost | append: record.file_links[0] %}
1011
{% assign ext = rawfile | slice: -4,4 %}
1112
{% elsif record.external_url and external_url_supports_xorigin_embeds %}

0 commit comments

Comments
 (0)