From f2613a9d93719e502a26f7542d9e076e08afe843 Mon Sep 17 00:00:00 2001 From: Nils Schneider Date: Fri, 9 Sep 2011 23:04:48 +0200 Subject: [PATCH 1/3] add default _config.yml --- _config.yml | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 _config.yml diff --git a/_config.yml b/_config.yml new file mode 100644 index 00000000..0be0c2d8 --- /dev/null +++ b/_config.yml @@ -0,0 +1,40 @@ +safe: false +auto: false +server: false +server_port: 4000 +base-url: / + +source: . +destination: ./_site +plugins: ./_plugins + +future: true +lsi: false +pygments: false +markdown: maruku +permalink: date + +maruku: + use_tex: false + use_divs: false + png_engine: blahtex + png_dir: images/latex + png_url: /images/latex + +rdiscount: + extensions: [] + +kramdown: + auto_ids: true, + footnote_nr: 1 + entity_output: as_char + toc_levels: 1..6 + use_coderay: false + + coderay: + coderay_wrap: div + coderay_line_numbers: inline + coderay_line_numbers_start: 1 + coderay_tab_width: 4 + coderay_bold_every: 10 + coderay_css: style From 1183de9fce0a7c52ddc33e13481538315f424405 Mon Sep 17 00:00:00 2001 From: Nils Schneider Date: Thu, 15 Sep 2011 00:09:41 +0200 Subject: [PATCH 2/3] more work on contributor list; merge contributors by name, use aliases from _config.yml --- _config.yml | 5 ++++ _plugins/contributors.rb | 55 ++++++++++++++++++++++++++++++++++++++++ index.html | 15 +++++++++++ lib/bitcoin.less | 4 +++ 4 files changed, 79 insertions(+) create mode 100644 _plugins/contributors.rb diff --git a/_config.yml b/_config.yml index 0be0c2d8..ab2918e5 100644 --- a/_config.yml +++ b/_config.yml @@ -38,3 +38,8 @@ kramdown: coderay_tab_width: 4 coderay_bold_every: 10 coderay_css: style + +aliases: + s_nakamoto: Satoshi Nakamoto + --author=Satoshi Nakamoto: Satoshi Nakamoto + gavinandresen: Gavin Andresen diff --git a/_plugins/contributors.rb b/_plugins/contributors.rb new file mode 100644 index 00000000..9b3e51c3 --- /dev/null +++ b/_plugins/contributors.rb @@ -0,0 +1,55 @@ +require 'open-uri' +require 'json' +require 'aquarium' +require 'yaml' + +module Jekyll + + class CategoryGenerator < Generator + def fetch_contributors + contributors = JSON.parse(open("http://github.com/api/v2/json/repos/show/bitcoin/bitcoin/contributors/anon").read)["contributors"] + + contributors.map do |x| + x['name'] = x['login'] unless x.has_key?('name') + x['name'] = x['login'] if x['name'] == "" + + x + end + end + + def merge_contributors(contributors, aliases) + contributors = contributors.map do |c| + c['name'] = aliases[c['name']] if aliases.has_key?(c['name']) + + c + end + + hoaoh = contributors.reduce({}) do |result, item| + result.merge({ item['name'] => [item] }) { |key, old, new| old[0]['contributions'] += new[0]['contributions']; old } + end + + hoaoh.values.map { |sublist| + sublist.reduce({}) do |merged,h| + merged.merge(h) do |key,old,new| (key=='name' ? old : old+new) end + end + }.flatten + end + + def generate(site) + @contributors = merge_contributors(fetch_contributors(), site.config['aliases']).sort_by{|c| - c['contributions']} + @primary_devs = JSON.parse(open("http://github.com/api/v2/json/repos/show/bitcoin/bitcoin/collaborators").read)["collaborators"] + + Aquarium::Aspects::Aspect.new :around, :invoking => :site_payload, :on_type => Site do |execution_point, site, *args| + result = execution_point.proceed + result['site']['project'] = { + "primary_devs" => @primary_devs, + "contributors" => @contributors + } + result + end + + end + + end + +end diff --git a/index.html b/index.html index d54d5a63..7f2301ff 100644 --- a/index.html +++ b/index.html @@ -14,6 +14,7 @@ ALERT:
  • News
  • About
  • Features
  • +
  • Contributors
  • @@ -208,4 +209,18 @@ ALERT: + +
    +

    Contributors ordered by number of commits

    + + + + + {% for c in site.project.contributors %} + + {% cycle nil, nil, nil, nil, '' %} + {% endfor %} + +
    {{ c.name }} ({{ c.contributions }})
    +
    diff --git a/lib/bitcoin.less b/lib/bitcoin.less index 328a741e..d0022dec 100644 --- a/lib/bitcoin.less +++ b/lib/bitcoin.less @@ -92,3 +92,7 @@ section { vertical-align: top; margin-right: 4px; } + +table.unstyled td { + border: none; +} From 88b9708c1eb335320ea052325346791170967284 Mon Sep 17 00:00:00 2001 From: Nils Schneider Date: Thu, 15 Sep 2011 00:12:42 +0200 Subject: [PATCH 3/3] remove empty line --- index.html | 1 - 1 file changed, 1 deletion(-) diff --git a/index.html b/index.html index 7f2301ff..50ff4dda 100644 --- a/index.html +++ b/index.html @@ -213,7 +213,6 @@ ALERT:

    Contributors ordered by number of commits

    - {% for c in site.project.contributors %}