Skip to content

Commit a05ad87

Browse files
committed
Added Github ribbon
Using this PR mmistakes/jekyll-theme-skinny-bones#37
1 parent 3307663 commit a05ad87

File tree

6 files changed

+82
-3
lines changed

6 files changed

+82
-3
lines changed

_config.yml

+11
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,17 @@ page_layout: article
3535
# Format titles with titlecase?
3636
titlecase: true
3737

38+
# GitHub Fork Ribbon
39+
40+
ghfr:
41+
display: # false to disable, null for visit, else blob/edit/custom
42+
organization: # github organization
43+
project: vdesabou/alfred-spotify-mini-player # github project
44+
branch: # branch this website is hosted on (master/gh-pages)
45+
text: Visit on GitHub
46+
blob: Source on GitHub
47+
edit: Edit on GitHub
48+
3849
# prose
3950
prose:
4051
rooturl: "_posts"

_includes/ghfr.html

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{% unless ghfr_display == false %}
2+
{% if page.ghfr.style %}
3+
{% assign ghfr_style = page.ghfr.style %}
4+
{% elsif site.ghfr.style %}
5+
{% assign ghfr_style = site.ghfr.style %}
6+
{% endif %}
7+
{% if page.ghfr.class %}
8+
{% assign ghfr_class = page.ghfr.class %}
9+
{% elsif site.ghfr.class %}
10+
{% assign ghfr_class = site.ghfr.class %}
11+
{% else %}
12+
{% assign ghfr_class = 'left' %}
13+
{% endif %}
14+
{% if page.ghfr.text %}
15+
{% assign ghfr_text = page.ghfr.text %}
16+
{% elsif site.ghfr[ghfr_display] %}
17+
{% assign ghfr_text = site.ghfr[ghfr_display] %}
18+
{% else %}
19+
{% assign ghfr_text = site.ghfr.text %}
20+
{% endif %}
21+
{% if ghfr_display == null %}
22+
{% if page.ghfr.link %}
23+
{% assign ghfr_link = page.ghfr.link %}
24+
{% elsif site.ghfr.link %}
25+
{% assign ghfr_link = site.ghfr.link %}
26+
{% else %}
27+
{% capture ghfr_link %}https://github.com/{{ site.ghfr.organization }}/{{ site.ghfr.project }}{% endcapture %}
28+
{% endif %}
29+
{% else %}
30+
{% capture ghfr_link %}https://github.com/{{ site.ghfr.organization}}/{{ site.ghfr.project }}/{{ ghfr_display }}/{{ site.ghfr.branch }}/{{ page.path }}{% endcapture %}
31+
{% endif %}
32+
<div class="github-fork-ribbon-wrapper {{ ghfr_class }}">
33+
<div class="github-fork-ribbon"{% if ghfr_style %} style="{{ ghfr_style }}"{% endif %}>
34+
<a href="{{ ghfr_link }}">{{ ghfr_text }}</a>
35+
</div>
36+
</div>
37+
{% endunless %}

_layouts/default.html

+12-1
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,22 @@
2626
<script src="{{ site.url }}/js/vendor/html5shiv.min.js"></script>
2727
<script src="{{ site.url }}/js/vendor/respond.min.js"></script>
2828
<![endif]-->
29-
29+
{% if page.ghfr.display != null %}
30+
{% assign ghfr_display = page.ghfr.display %}
31+
{% else %}
32+
{% assign ghfr_display = site.ghfr.display %}
33+
{% endif %}
34+
{% unless ghfr_display == false %}
35+
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/github-fork-ribbon-css/0.1.1/gh-fork-ribbon.min.css" />
36+
<!--[if lt IE 9]>
37+
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/github-fork-ribbon-css/0.1.1/gh-fork-ribbon.ie.min.css" />
38+
<![endif]-->
39+
{% endunless %}
3040
</head>
3141

3242
<body id="js-body">
3343
{% include browser-upgrade.html %}
44+
{% include ghfr.html %}
3445
{% include header.html %}
3546
{% include navigation-sliding.html %}
3647

_layouts/home.html

+13-2
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,22 @@
3434
<script src="{{ site.url }}/js/vendor/respond.min.js"></script>
3535
<![endif]-->
3636
{% include google_analytics.html %}
37-
37+
{% if page.ghfr.display != null %}
38+
{% assign ghfr_display = page.ghfr.display %}
39+
{% else %}
40+
{% assign ghfr_display = site.ghfr.display %}
41+
{% endif %}
42+
{% unless ghfr_display == false %}
43+
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/github-fork-ribbon-css/0.1.1/gh-fork-ribbon.min.css" />
44+
<!--[if lt IE 9]>
45+
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/github-fork-ribbon-css/0.1.1/gh-fork-ribbon.ie.min.css" />
46+
<![endif]-->
47+
{% endunless %}
3848
</head>
3949

4050
<body id="js-body">
4151
{% include browser-upgrade.html %}
52+
{% include ghfr.html %}
4253
{% include header.html %}
4354
{% include navigation-sliding.html %}
4455

@@ -47,7 +58,7 @@
4758
<div class="wrap page-lead-content">
4859
<h1>Alfred Spotify Mini Player</h1>
4960
<h2>Alfred 2 workflow to control your Spotify library at your fingertips</h2>
50-
<a href="https://github.com/packal/repository/raw/master/com.vdesabou.spotify.mini.player/spotifyminiplayer.alfredworkflow" class="btn-success"><i class="fa fa-download"></i> Download (v6.2.6)</a> <a href="http://alfred-spotify-mini-player.com/setup/" class="btn-danger"><i class="fa fa-cog"></i> First time use?</a> <a href="https://github.com/vdesabou/alfred-spotify-mini-player/" target="_blank" class="btn-warning"><i class="fa fa-github"></i> View on GitHub</a> <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=J5GAJ2SR89TLQ " target="_blank" class="btn-info"><i class="fa fa-beer"></i> Buy me a beer!</a>
61+
<a href="https://github.com/packal/repository/raw/master/com.vdesabou.spotify.mini.player/spotifyminiplayer.alfredworkflow" class="btn-success"><i class="fa fa-download"></i> Download (v6.2.6)</a> <a href="http://alfred-spotify-mini-player.com/setup/" class="btn-danger"><i class="fa fa-cog"></i> First time use?</a> <!--<a href="https://github.com/vdesabou/alfred-spotify-mini-player/" target="_blank" class="btn-warning"><i class="fa fa-github"></i> View on GitHub</a> --><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=J5GAJ2SR89TLQ " target="_blank" class="btn-warning"><i class="fa fa-beer"></i> Buy me a beer!</a>
5162
</div><!-- /.page-lead-content -->
5263
</div><!-- /.page-lead -->
5364
{% endif %}

_sass/_ghfr.scss

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.github-fork-ribbon-wrapper {
2+
z-index: 19 !important;
3+
}
4+
5+
.github-fork-ribbon {
6+
background-color: $info-color !important;
7+
opacity: .5;
8+
}

css/main.scss

+1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ sitemap: false
4747
@import "toc"; /* table of contents */
4848
@import "breadcrumbs";
4949
@import "syntax";
50+
@import "ghfr";
5051

5152
/*
5253
Page specific

0 commit comments

Comments
 (0)