Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added conditional download links #42

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ Additionally, you may choose to set the following optional variables:

```yml
show_downloads: ["true" or "false" to indicate whether to provide a download URL]
zip_url: ["true" or "false" to indicate whether to provide a .zip download URL]
tar_url: ["true" or "false" to indicate whether to provide a .tar.gz download URL]
google_analytics: [Your Google Analytics tracking ID]
```

Expand Down Expand Up @@ -74,7 +76,7 @@ Templates often rely on URLs supplied by GitHub such as links to your repository
```yml
github:
zip_url: http://example.com/download.zip
another_url: another value
tar_url: http://example.com/download.tar.gz
```
3. When your site is built, Jekyll will use the URL you specified, rather than the default one provided by GitHub.

Expand Down
4 changes: 3 additions & 1 deletion _config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
title: Architect theme
description: Architect is a theme for GitHub Pages.
show_downloads: true
zip_url: true
tar_url: true
google_analytics:
theme: jekyll-theme-architect
theme: jekyll-theme-architect
4 changes: 4 additions & 0 deletions _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,18 @@ <h2>{{ site.description | default: site.github.project_tagline }}</h2>

<aside id="sidebar">
{% if site.show_downloads %}
{% if site.show_downloads.zip_url|default(true) %}
<a href="{{ site.github.zip_url }}" class="button">
<small>Download</small>
.zip file
</a>
{% endif %}
{% if site.show_downloads.tar_url|default(true) %}
<a href="{{ site.github.tar_url }}" class="button">
<small>Download</small>
.tar.gz file
</a>
{% endif %}
{% endif %}

{% if site.github.is_project_page %}
Expand Down