diff options
author | pdp8 <pdp8@pdp8.info> | 2022-08-22 00:52:15 +0200 |
---|---|---|
committer | pdp8 <pdp8@pdp8.info> | 2022-08-22 00:52:15 +0200 |
commit | e3c672f4648997dbe00624e09c63c990a8ea3596 (patch) | |
tree | 2b81023c89da84b09188d9bbbcc3d907faf8df6f /snippets/Fork-Awesome-1.2.0/src/doc/_plugins/all-contributors-generator.rb | |
parent | 28792e4d504d59b5aeab70d66ea6be51c9c683b1 (diff) |
audio and video rendering, Fork-Awesome-1.2.0 included
Diffstat (limited to 'snippets/Fork-Awesome-1.2.0/src/doc/_plugins/all-contributors-generator.rb')
-rw-r--r-- | snippets/Fork-Awesome-1.2.0/src/doc/_plugins/all-contributors-generator.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/snippets/Fork-Awesome-1.2.0/src/doc/_plugins/all-contributors-generator.rb b/snippets/Fork-Awesome-1.2.0/src/doc/_plugins/all-contributors-generator.rb new file mode 100644 index 0000000..85d0328 --- /dev/null +++ b/snippets/Fork-Awesome-1.2.0/src/doc/_plugins/all-contributors-generator.rb @@ -0,0 +1,17 @@ +## +# Generate an all-contributors badge with the number of contributors + +require "json" + +module Jekyll + class AllContributors < Generator + def generate(site) + all_contributors_rc = File.read(File.join(Dir.pwd, '.all-contributorsrc')) + all_contributors = JSON.parse(all_contributors_rc) + total_contributors = all_contributors['contributors'].length + site.pages.each do |page| + page.data['total_contributors'] = total_contributors + end + end + end +end |