Skip to content

Commit 0f4cec8

Browse files
committed
Enable downloading of codelib releases from GitHub
Modified codelib-tplt.html to use the new `use-github-for-downloads` page variable to decide whether to make the download button in the page header bar link to the current release page on GitHub instead of a SourceForge direct download. The SourceForge download remains the default if `use-github-for-downloads` is set to false or is undefined. The GitHub link is used when `use-github-for-downloads` is set to true.
1 parent 5cac721 commit 0f4cec8

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

_layouts/codelib-tplt.html

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
---
22
layout: default
33
---
4-
{% assign dl-url = page.download-base-url | append: page.dl-file-prefix | append: page.version | append: ".zip" %}
4+
{% if page.use-github-for-downloads %}
5+
{%assign dl-url = page.repo-url | append: "/tag/version-" | append: page.version %}
6+
{%assign dl-label = "Go to the release page of the latest version on GitHub" %}
7+
{% else %}
8+
{% assign dl-url = page.download-base-url | append: page.dl-file-prefix | append: page.version | append: ".zip" %}
9+
{% assign dl-label = "Go to SourceForge and download latest version automatically" %}
10+
{% endif %}
511
{% if page.status == "mothballed" %}
612
{% assign headercls = "mothballed" %}
713
{% elsif page.status == "obsolete" %}
@@ -19,8 +25,8 @@ <h1>{{ page.title | escape }}</h1>
1925
<a
2026
href="{{ dl-url }}"
2127
class="btn btn-primary"
22-
aria-label="Go to SourceForge and download latest version automatically"
23-
title="Go to SourceForge and download latest version automatically"
28+
aria-label="{{ dl-label }}"
29+
title="{{ dl-label }}"
2430
><span
2531
class="fa fa-download fa-x-pad-right"
2632
aria-hidden="true">

0 commit comments

Comments
 (0)