Set download link to latest version if available

This commit is contained in:
squidfunk 2016-02-13 17:24:16 +01:00
parent de5be52f18
commit 9233074124
3 changed files with 11 additions and 5 deletions

View File

@ -1,3 +1,7 @@
mkdocs-material-0.x.x (2016-xx-xx)
* Set download link to latest version if available
mkdocs-material-0.1.1 (2016-02-11) mkdocs-material-0.1.1 (2016-02-11)
* Fixed #1: GitHub stars don't work if the repo_url ends with a '/' * Fixed #1: GitHub stars don't work if the repo_url ends with a '/'

View File

@ -20,12 +20,13 @@
{% if repo_name == 'GitHub' %} {% if repo_name == 'GitHub' %}
<ul class="repo"> <ul class="repo">
<li class="repo-download"> <li class="repo-download">
<a href="https://github.com/{{ repo_id }}/archive/master.zip" target="_blank" aria-label="Download {{ repo_id }} on GitHub"> {% set version = config.extra.version | default('master') %}
<a href="{{ repo_url }}/archive/{{ version }}.zip" target="_blank" aria-label="Download {{ repo_id }} from GitHub">
<i class="icon icon-download"></i> Download <i class="icon icon-download"></i> Download
</a> </a>
</li> </li>
<li class="repo-stars"> <li class="repo-stars">
<a href="https://github.com/{{ repo_id }}" target="_blank" aria-label="Star {{ repo_id }} on GitHub"> <a href="{{ repo_url }}" target="_blank" aria-label="Star {{ repo_id }} on GitHub">
<i class="icon icon-star"></i> Star <i class="icon icon-star"></i> Star
<span class="count">&ndash;</span> <span class="count">&ndash;</span>
</a> </a>

View File

@ -35,13 +35,14 @@
{% if repo_name == 'GitHub' %} {% if repo_name == 'GitHub' %}
<ul class="repo"> <ul class="repo">
<li class="repo-download"> <li class="repo-download">
<a href="https://github.com/{{ repo_id }}/archive/master.zip" {% set version = config.extra.version | default('master') %}
target="_blank" aria-label="Download {{ repo_id }} on GitHub"> <a href="{{ repo_url }}/archive/{{ version }}.zip"
target="_blank" aria-label="Download {{ repo_id }} from GitHub">
<i class="icon icon-download"></i> Download <i class="icon icon-download"></i> Download
</a> </a>
</li> </li>
<li class="repo-stars"> <li class="repo-stars">
<a href="https://github.com/{{ repo_id }}" <a href="{{ repo_url }}"
target="_blank" aria-label="Star {{ repo_id }} on GitHub"> target="_blank" aria-label="Star {{ repo_id }} on GitHub">
<i class="icon icon-star"></i> Star <i class="icon icon-star"></i> Star
<span class="count">&ndash;</span> <span class="count">&ndash;</span>