Skip to content

Commit 1958753

Browse files
committed
More info about download
1 parent 1baaeb9 commit 1958753

File tree

5 files changed

+105
-18
lines changed

5 files changed

+105
-18
lines changed

_config.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,32 @@
22
name: jQuery QueryBuilder
33
# current version of the software
44
version: 2.4.1
5-
# url of the download button
6-
downloadUrl: https://github.com/mistic100/jQuery-QueryBuilder
75
# links to file/dir viewers
86
treeUrl: https://github.com/mistic100/jQuery-QueryBuilder/tree/master
97
blobUrl: https://github.com/mistic100/jQuery-QueryBuilder/blob/master
108
cdnUrl: https://cdn.jsdelivr.net/jquery.query-builder/2.4.1
119
# licence of the software
1210
license: MIT License
1311
licenseUrl: http://opensource.org/licenses/MIT
12+
# extension of the favicon, blank to disable
13+
favicon:
1414

15+
# download button
16+
# if download.popup is true, the download button will open a popup with several download options
17+
# otherwise it will simply open download.url and other options are ignored
18+
# if download.popup is true, any option is optional
19+
# download.cdn.img is optional
20+
download:
21+
popup: true
22+
url: https://github.com/mistic100/jQuery-QueryBuilder/archive/2.4.1.zip
23+
bower: jQuery-QueryBuilder
24+
npm: jQuery-QueryBuilder
25+
cdn:
26+
url: https://www.jsdelivr.com/projects/jquery.query-builder
27+
img: http://querybuilder.js.org/assets/images/jsdelivr-logo.png
28+
name: jsDelivr
29+
30+
# set this to true to replace the generated header navbar by _includes/navbar.html
1531
customNavBar: true
1632

1733
# list of additional links on the right of the top menu

_includes/download-popup.html

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
<div class="row">
2+
{% if site.download.url %}
3+
<div class="col-sm-6">
4+
<div class="panel panel-default">
5+
<div class="panel-heading">Manual download</div>
6+
<div class="panel-body">
7+
<p>Compiled and minified files with examples and sources.</p>
8+
<a href="{{site.download.url}}" class="btn btn-lg btn-outline">
9+
<i class="glyphicon glyphicon-save"></i>
10+
Download
11+
</a>
12+
</div>
13+
</div>
14+
</div>
15+
{% endif %}
16+
17+
{% if site.download.cdn and site.download.cdn.url %}
18+
<div class="col-sm-6">
19+
<div class="panel panel-default">
20+
<div class="panel-heading">Content Delivery Network</div>
21+
<div class="panel-body">
22+
<p>The package is available on {{site.download.cdn.name}}.</p>
23+
{% if site.download.cdn.img %}
24+
<a href="{{site.download.cdn.url}}" class="btn btn-lg btn-outline" style="max-width: 50%">
25+
<img src="{{site.download.cdn.img}}" class="img-responsive"/>
26+
</a>
27+
{% else %}
28+
<a href="{{site.download.cdn.url}}" class="btn btn-lg btn-outline">Download</a>
29+
{% endif %}
30+
</div>
31+
</div>
32+
</div>
33+
{% endif %}
34+
35+
{% if site.download.bower %}
36+
<div class="col-sm-6">
37+
<div class="panel panel-default">
38+
<div class="panel-heading">Install with Bower</div>
39+
<div class="panel-body">
40+
<p>You can also get all necessary files and dependencies with <a href="http://bower.io">Bower</a>.</p>
41+
<!-- @formatter:off -->
42+
{% highlight bash %}
43+
$ bower install {{site.download.bower}}
44+
{% endhighlight %}
45+
<!-- @formatter:on -->
46+
</div>
47+
</div>
48+
</div>
49+
{% endif %}
50+
51+
{% if site.download.npm %}
52+
<div class="col-sm-6">
53+
<div class="panel panel-default">
54+
<div class="panel-heading">Install with npm</div>
55+
<div class="panel-body">
56+
<p>You can also get all necessary files and dependencies with <a href="https://www.npmjs.com">npm</a>.</p>
57+
<!-- @formatter:off -->
58+
{% highlight bash %}
59+
$ npm install {{site.download.npm}}
60+
{% endhighlight %}
61+
<!-- @formatter:on -->
62+
</div>
63+
</div>
64+
</div>
65+
{% endif %}
66+
67+
</div>

_layouts/default.html

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66

77
<title>{{site.name}}</title>
88

9+
{% if site.favicon %}
10+
<link rel="icon" type="{% if site.favicon == 'png' %}image/png{% else %}image/x-icon{% endif %}" href="{{site.github.url}}/favicon.{{site.favicon}}"/>
11+
{% endif %}
12+
913
<!--[if lt IE 9]>
1014
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
1115
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
@@ -77,12 +81,22 @@
7781
<h1 class="home-title">{{site.name}}</h1>
7882
<p class="lead">{{page.description}}</p>
7983
<p class="lead">
80-
<a href="{{site.downloadUrl}}" class="btn btn-outline-inverse btn-lg">Download</a>
84+
{% if site.download.popup %}
85+
<a data-bootbox="download-popup" data-bootbox-size="large" class="btn btn-outline-inverse btn-lg">Download</a>
86+
{% else %}
87+
<a href="{{site.download.url}}" class="btn btn-outline-inverse btn-lg">Download</a>
88+
{% endif %}
8189
</p>
8290
<p class="version">Currently v{{site.version}}</p>
8391
</div>
8492
</div>
8593

94+
{% if site.download.popup %}
95+
<div id="download-popup" title="Download {{site.name}} {{site.version}}" class="hidden">
96+
{% include download-popup.html %}
97+
</div>
98+
{% endif %}
99+
86100
{% else %}
87101
<div class="bs-docs-header" id="content">
88102
<div class="container">

assets/js/docs.min.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ $(function(){
3333
var $target = $('#'+$(this).data('bootbox'));
3434
bootbox.alert({
3535
title: $target.attr('title'),
36-
message: $target.html()
36+
message: $target.html(),
37+
size: $(this).data('bootbox-size')
3738
});
3839
});
3940

@@ -56,4 +57,4 @@ function trianglify(color1, color2) {
5657
pattern = t.generate(window.screen.width | header.outerWidth(), header.outerHeight()*1.2);
5758

5859
header.css('background-image', pattern.dataUrl);
59-
}
60+
}

index.html

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,21 +37,10 @@ <h1 id="overview" class="page-header">
3737

3838
<section class="bs-docs-section">
3939
<h1 id="installation" class="page-header">
40-
Installation
40+
Getting started
4141
</h1>
4242

43-
<div class="bs-callout bs-callout-info">
44-
<div class="pull-right">
45-
<a href="http://www.jsdelivr.com/projects/jquery.query-builder">
46-
<img width="190" src="{{site.github.url}}/assets/images/jsdelivr-logo.png"/>
47-
</a>
48-
</div>
49-
50-
<h4>Content Delivery Network</h4>
51-
52-
<p>jQuery-QueryBuilder is <a href="http://www.jsdelivr.com/projects/jquery.query-builder">available on jsDelivr</a>.
53-
</p>
54-
</div>
43+
<a data-bootbox="download-popup" data-bootbox-size="large" class="btn btn-outline">Download {{site.name}}</a>
5544

5645
<h3 id="dependencies">Dependencies</h3>
5746
<ul>

0 commit comments

Comments
 (0)