summaryrefslogtreecommitdiff
path: root/static/fork-awesome/src/doc/_plugins/all-contributors-generator.rb
diff options
context:
space:
mode:
authorDavid Luevano Alvarado <david@luevano.xyz>2021-06-01 03:21:33 -0600
committerDavid Luevano Alvarado <david@luevano.xyz>2021-06-01 03:21:33 -0600
commit6d2c067f0d6bc78eef7ececcec3eba71cbb5d80c (patch)
treefeb9c3b13d2603526fee6fbd876f5bd8dfe5bcf2 /static/fork-awesome/src/doc/_plugins/all-contributors-generator.rb
parentbda8405ebdf2cad9cd2f316d6e5371fece798353 (diff)
add fork awesome, contact and donate pages, update general style and update readme
Diffstat (limited to 'static/fork-awesome/src/doc/_plugins/all-contributors-generator.rb')
-rw-r--r--static/fork-awesome/src/doc/_plugins/all-contributors-generator.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/static/fork-awesome/src/doc/_plugins/all-contributors-generator.rb b/static/fork-awesome/src/doc/_plugins/all-contributors-generator.rb
new file mode 100644
index 0000000..85d0328
--- /dev/null
+++ b/static/fork-awesome/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