Skip to content

Commit 51ee447

Browse files
author
housseindjirdeh
committed
adds contributor section to footer
1 parent 7d98469 commit 51ee447

File tree

6 files changed

+83
-5
lines changed

6 files changed

+83
-5
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
_site
22
.sass-cache
33
.jekyll-metadata
4+
.DS_Store
45
node_modules

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ gem "minima", "~> 2.0"
2020

2121
# If you have any plugins, put them here!
2222
group :jekyll_plugins do
23+
gem 'hash-joiner'
2324
gem "jekyll-feed", "~> 0.6"
2425
gem 'jekyll-sitemap'
2526
end

Gemfile.lock

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ GEM
66
colorator (1.1.0)
77
ffi (1.9.18)
88
forwardable-extended (2.6.0)
9+
hash-joiner (0.0.7)
10+
safe_yaml
911
jekyll (3.3.1)
1012
addressable (~> 2.4)
1113
colorator (~> 1.0)
@@ -47,13 +49,14 @@ PLATFORMS
4749
ruby
4850

4951
DEPENDENCIES
52+
hash-joiner
5053
jekyll (= 3.3.1)
5154
jekyll-feed (~> 0.6)
5255
jekyll-sitemap
5356
minima (~> 2.0)
5457

5558
RUBY VERSION
56-
ruby 2.3.1p112
59+
ruby 2.3.3p222
5760

5861
BUNDLED WITH
5962
1.14.6

_config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ twitter_username: "@hdjirdeh"
2323
github_username: "housseindjirdeh"
2424
google_analytics: UA-66348622-4
2525

26+
# API
27+
jekyll_get:
28+
data: contributorResponse
29+
json: 'https://raw.githubusercontent.com/gitpoint/git-point/master/.all-contributorsrc'
30+
2631
# Build settings
2732
markdown: kramdown
2833
gems:

_includes/footer.html

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,32 @@
1-
<footer class="pv4 ph3 ph5-m ph6-l dark-gray bg-primary karla">
2-
<div class="f5 f4-ns db tc mt2 mb4">Brought to you by <a class="link fw7 dark-gray dim" href="https://houssein.me/">Houssein Djirdeh</a> and <a class="link fw7 dark-gray dim" href="https://github.com/gitpoint/git-point/graphs/contributors">awesome contributors 🎉</a></div>
3-
<div class="f6 f5-ns db tc">Show this project some ❤ on <a class="link fw7 dark-gray dim" href="https://github.com/gitpoint/git-point">GitHub</a></div>
4-
</footer>
1+
<footer class="tc pv4 pv4-ns flex flex-column items-center avenir bt b--black-10">
2+
<h3 class="f5 f4-ns fw4 dark-gray">Brought to you by</h3>
3+
4+
<div class="flex flex-column flex-wrap flex-row-ns justify-between center w-100 w-90-l">
5+
6+
{% for contributor in site.data.contributorResponse.contributors%}
7+
{% assign loopindex = forloop.index | modulo: 2 %}
8+
{% if loopindex == 1 %}
9+
<div class="flex flex-column items-center mv3 w-100 w-50-m w-auto-l">
10+
<div>
11+
<a class="link" href={{ contributor.profile }}>
12+
<img src={{ contributor.avatar_url }} class="grow-large pa1 ba b--black-10 br-100 h3 w3" alt={{ contributor.name }}>
13+
</a>
14+
15+
{% assign name = contributor.name | split:&nbsp; %}
16+
<h4 class="f6 mid-gray fw4 ttu tracked">{{ name[0] }}</h4>
17+
</div>
18+
{% else %}
19+
<div>
20+
<a class="link" href={{ contributor.profile }}>
21+
<img src={{ contributor.avatar_url }} class="grow-large pa1 ba b--black-10 br-100 h3 w3" alt={{ contributor.name }}>
22+
</a>
23+
24+
{% assign name = contributor.name | split:&nbsp; %}
25+
<h4 class="f6 mid-gray fw4 ttu tracked">{{ name[0] }}</h4>
26+
</div>
27+
</div>
28+
{% endif %}
29+
{% endfor %}
30+
31+
</div>
32+
</footer>

_plugins/jekyll_get.rb

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
require 'json'
2+
require 'hash-joiner'
3+
require 'open-uri'
4+
5+
module Jekyll_Get
6+
class Generator < Jekyll::Generator
7+
safe true
8+
priority :highest
9+
10+
def generate(site)
11+
config = site.config['jekyll_get']
12+
if !config
13+
return
14+
end
15+
if !config.kind_of?(Array)
16+
config = [config]
17+
end
18+
config.each do |d|
19+
begin
20+
target = site.data[d['data']]
21+
source = JSON.load(open(d['json']))
22+
if target
23+
HashJoiner.deep_merge target, source
24+
else
25+
site.data[d['data']] = source
26+
end
27+
if d['cache']
28+
data_source = (site.config['data_source'] || '_data')
29+
path = "#{data_source}/#{d['data']}.json"
30+
open(path, 'wb') do |file|
31+
file << JSON.generate(site.data[d['data']])
32+
end
33+
end
34+
rescue
35+
next
36+
end
37+
end
38+
end
39+
end
40+
end

0 commit comments

Comments
 (0)