Skip to content
This repository has been archived by the owner on May 17, 2020. It is now read-only.

Commit

Permalink
add download popup and custom navbar
Browse files Browse the repository at this point in the history
  • Loading branch information
mistic100 committed Feb 4, 2017
1 parent 30a956d commit b08cd4f
Show file tree
Hide file tree
Showing 12 changed files with 260 additions and 60 deletions.
8 changes: 8 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
root = true

[*]
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/_site
Gemfile.lock
/Gemfile.lock
/dist/bootstrap
/dist/jquery
/dist/jquery
/.idea
/*.iml
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
source 'https://rubygems.org'
gem 'github-pages'
gem 'nokogiri', '1.6.8.1'
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2014 Damien Sorel
Copyright (c) 2014-2017 Damien Sorel

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
28 changes: 24 additions & 4 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,37 @@
# name of the software
name: Jekyll Bootstrap Doc
# current version of the software
version: 1.1.0
# url of the download button
downloadUrl: https://github.com/mistic100/jekyll-bootstrap-doc
version: 1.2.0
# licence of the software
license: MIT License
licenseUrl: http://opensource.org/licenses/MIT
# extension of the favicon, blank to disable
favicon: png

# download button
# if download.popup is true, the download button will open a popup with several download options
# otherwise it will simply open download.url and other options are ignored
# if download.popup is true, any option is optional
# download.cdn.img is optional
download:
popup: true
url: https://github.com/mistic100/jekyll-bootstrap-doc/archive/gh-pages.zip
bower: jekyll-bootstrap-doc
npm: jekyll-bootstrap-doc
cdn:
url: https://cdnjs.com/libraries/jekyll-bootstrap-doc
img: https://alemangui.github.io/pizzicato/img/cdnjs.svg
name: cdnjs

# set this to true to replace the generated header navbar by _includes/navbar.html
customNavBar: false

# list of additional links on the right of the top menu
headerLinks:
- title: GitHub
url: https://github.com/mistic100/jekyll-bootstrap-doc
- title: StrangePlanet
url: http://www.strangeplanet.fr

# list if additional links on the footer
footerLinks:
Expand Down Expand Up @@ -55,4 +75,4 @@ gems:
- jekyll-mentions
- jemoji
- jekyll-redirect-from
- jekyll-sitemap
- jekyll-sitemap
66 changes: 66 additions & 0 deletions _includes/download-popup.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<div class="row">
{% if site.download.url %}
<div class="col-sm-6">
<div class="panel panel-default">
<div class="panel-heading">Manual download</div>
<div class="panel-body">
<p>Compiled and minified files with examples and sources.</p>
<a href="{{site.download.url}}" class="btn btn-lg btn-outline">
<i class="glyphicon glyphicon-save"></i>
Download
</a>
</div>
</div>
</div>
{% endif %}

{% if site.download.cdn and site.download.cdn.url %}
<div class="col-sm-6">
<div class="panel panel-default">
<div class="panel-heading">Content Delivery Network</div>
<div class="panel-body">
<p>The package is available on {{site.download.cdn.name}}.</p>
{% if site.download.cdn.img %}
<a href="{{site.download.cdn.url}}" class="btn btn-lg btn-outline" style="max-width: 50%">
<img src="{{site.download.cdn.img}}" class="img-responsive"/>
</a>
{% else %}
<a href="{{site.download.cdn.url}}" class="btn btn-lg btn-outline">Download</a>
{% endif %}
</div>
</div>
</div>
{% endif %}

{% if site.download.bower %}
<div class="col-sm-6">
<div class="panel panel-default">
<div class="panel-heading">Install with Bower</div>
<div class="panel-body">
<p>You can also get all necessary files and dependencies with <a href="http://bower.io">Bower</a>.</p>
<!-- @formatter:off -->
{% highlight bash %}
$ bower install {{site.download.bower}}
{% endhighlight %}
<!-- @formatter:on -->
</div>
</div>
</div>
{% endif %}

{% if site.download.npm %}
<div class="col-sm-6">
<div class="panel panel-default">
<div class="panel-heading">Install with npm</div>
<div class="panel-body">
<p>You can also get all necessary files and dependencies with <a href="https://www.npmjs.com">npm</a>.</p>
<!-- @formatter:off -->
{% highlight bash %}
$ npm install {{site.download.npm}}
{% endhighlight %}
<!-- @formatter:on -->
</div>
</div>
</div>
{% endif %}
</div>
16 changes: 16 additions & 0 deletions _includes/navbar.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<li {% if page.title == 'page1' %}class="active"{% endif %}>
<a href="{{site.github.url}}/page1.html">Page 1</a>
</li>

<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button">Menu <span class="caret"></span></a>
<ul class="dropdown-menu">
<li {% if page.title == 'page2.1' %}class="active"{% endif %}>
<a href="{{site.github.url}}/page2.1.html">Page 2.1</a>
</li>

<li {% if page.title == 'page2.2' %}class="active"{% endif %}>
<a href="{{site.github.url}}/page2.2.html">Page 2.2</a>
</li>
</ul>
</li>
50 changes: 34 additions & 16 deletions _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

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

{% if site.favicon %}
<link rel="icon" type="{% if site.favicon == 'png' %}image/png{% else %}image/x-icon{% endif %}" href="{{site.github.url}}/favicon.{{site.favicon}}"/>
{% endif %}

<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
Expand Down Expand Up @@ -44,21 +48,25 @@
</div>
<nav class="collapse navbar-collapse bs-navbar-collapse" role="navigation">
<ul class="nav navbar-nav">
{% assign sorted_pages = site.pages | sort:"name" %}
{% for p in sorted_pages %}
{% if p.isHome != true and p.hide != true and p.title != %}
<li {% if page.title == p.title %}class="active"{% endif %}>
<a href="{{site.github.url}}{{p.url}}">{{p.title}}</a>
</li>
{% endif %}
{% endfor %}
</ul>
<ul class="nav navbar-nav navbar-right">
{% for p in site.headerLinks %}
<li>
<a href="{{p.url}}">{{p.title}}</a>
</li>
{% endfor %}
{% if site.customNavBar %}
{% include navbar.html %}
{% else %}
{% assign sorted_pages = site.pages | sort:"name" %}
{% for p in sorted_pages %}
{% if p.isHome != true and p.hide != true and p.title != '' %}
<li {% if page.title == p.title %}class="active"{% endif %}>
<a href="{{site.github.url}}{{p.url}}">{{p.title}}</a>
</li>
{% endif %}
{% endfor %}
</ul>
<ul class="nav navbar-nav navbar-right">
{% for p in site.headerLinks %}
<li>
<a href="{{p.url}}">{{p.title}}</a>
</li>
{% endfor %}
{% endif %}
</ul>
</nav>
</div>
Expand All @@ -73,12 +81,22 @@
<h1 class="home-title">{{site.name}}</h1>
<p class="lead">{{page.description}}</p>
<p class="lead">
<a href="{{site.downloadUrl}}" class="btn btn-outline-inverse btn-lg">Download</a>
{% if site.download.popup %}
<a data-bootbox="download-popup" data-bootbox-size="large" class="btn btn-outline-inverse btn-lg">Download</a>
{% else %}
<a href="{{site.download.url}}" class="btn btn-outline-inverse btn-lg">Download</a>
{% endif %}
</p>
<p class="version">Currently v{{site.version}}</p>
</div>
</div>

{% if site.download.popup %}
<div id="download-popup" title="Download {{site.name}} {{site.version}}" class="hidden">
{% include download-popup.html %}
</div>
{% endif %}

{% else %}
<div class="bs-docs-header" id="content">
<div class="container">
Expand Down
3 changes: 2 additions & 1 deletion assets/js/docs.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ $(function(){
var $target = $('#'+$(this).data('bootbox'));
bootbox.alert({
title: $target.attr('title'),
message: $target.html()
message: $target.html(),
size: $(this).data('bootboxSize')
});
});

Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jekyll-bootstrap-doc",
"version": "1.1.0",
"version": "1.2.0",

"dependencies": {

Expand Down
Binary file added favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit b08cd4f

Please sign in to comment.