jekyll-github-repos 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: f6532dc9ada3e92dcc00ecf2c61caba6472211a956330b32abe46a57729e9591
4
+ data.tar.gz: 9b38bad0d392e92aca4e6d81a58a754224e393b97f09e7c1b203304cb3695bef
5
+ SHA512:
6
+ metadata.gz: bdd3f09176a1c967ebb85978289e411340fc349865f3acf742b365ad7819b09201714474bc177bd534b3e900cef7f58d9ffe3037c7048507dcfacfffdf90bfd4
7
+ data.tar.gz: 7fe8b67348f5de43c6729377125a6c9d849a681e3fa011b7641897cc7ac18c4e68640332e037f0cd9cf0d5f073cc450cea953b74115d87cd1b5f7f9dcc70b7a8
data/License ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 Midhun Devasia
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,51 @@
1
+ # `jekyll-github-repos`: Jekyll Plugin for List Github Repositories
2
+
3
+ The GitHub Repositories Jekyll Plugin (`jekyll-github-repos`) is a custom Jekyll generator that fetches and lists GitHub repositories for a specified user. It uses the Octokit gem to interact with the GitHub API and retrieve repository data.
4
+
5
+ ## Installation
6
+ Add the gem to your Jekyll project's Gemfile:
7
+
8
+ ```ruby
9
+ gem 'octokit'
10
+ gem 'jekyll-github-repos', '~> 1.0'
11
+ ```
12
+
13
+ Then, run `bundle install` to install the required gems.
14
+
15
+ ## Configuration
16
+ In your Jekyll project's `_config.yml`, add the following settings:
17
+
18
+ ```yaml
19
+ github_repos:
20
+ username: your_github_username
21
+ access_token: your_github_access_token
22
+ ```
23
+
24
+ Replace `your_github_username` and `your_github_access_token` with your actual GitHub username and access token. Ensure that the access token has the necessary permissions to access the repositories.
25
+
26
+ ## Usage
27
+ After configuring the plugin, the GitHub Repositories data will be available in your Jekyll site's `site.data['github_repos']` variable. You can use it in your Liquid templates to display the repositories.
28
+
29
+ For example, in your Liquid template:
30
+
31
+ ```liquid
32
+ {% for repo in site.data.github_repos %}
33
+ <h2><a href="{{ repo.url }}">{{ repo.name }}</a></h2>
34
+ <p>{{ repo.desc }}</p>
35
+ {% endfor %}
36
+ ```
37
+
38
+ ## License
39
+ This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
40
+
41
+ ## Contributing
42
+ Bug reports and pull requests are welcome on GitHub at [github.com/midhundevasia/jekyll-github-repos](https://github.com/midhundevasia/jekyll-github-repos). Please read our [Contributing Guide](CONTRIBUTING.md) for more information.
43
+
44
+ ## About the Author
45
+ This plugin is developed and maintained by Your Name. You can find more of my projects at [midhundev.asia](https://midhundev.asia/projects).
46
+
47
+ ## Support
48
+ For questions, issues, or feature requests, please [open an issue](https://github.com/midhundevasia/jekyll-github-repos/issues).
49
+
50
+ ## Acknowledgements
51
+ Special thanks to the [Octokit](https://github.com/octokit/octokit.rb) gem for providing an easy-to-use Ruby interface for the GitHub API.
@@ -0,0 +1,27 @@
1
+ require_relative "lib/version"
2
+
3
+ Gem::Specification.new do |spec|
4
+ spec.name = 'jekyll-github-repos'
5
+ spec.version = Jekyll::GitHubReposVersion::VERSION
6
+ spec.summary = 'Jekyll plugin to fetch and list GitHub repositories'
7
+ spec.description = 'A Jekyll plugin to fetch and list GitHub repositories in Liquid templates'
8
+ spec.authors = ['Midhun Devasia']
9
+ spec.email = 'hello@midhundev.asia'
10
+ spec.homepage = 'https://github.com/midhundevasia/jekyll-github-repos'
11
+ spec.license = 'MIT'
12
+
13
+ spec.files = Dir['lib/**/*', 'jekyll-github-repos.gemspec', 'README.md', 'License']
14
+ spec.require_paths = ['lib']
15
+
16
+ if spec.respond_to?(:metadata)
17
+ spec.metadata["allowed_push_host"] = "https://rubygems.org"
18
+ else
19
+ raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
20
+ end
21
+
22
+ spec.add_dependency "jekyll", ">= 3.7", "< 5.0"
23
+ spec.add_dependency "octokit", ">= 5.6"
24
+ spec.add_development_dependency "bundler", "~> 1.15"
25
+
26
+ end
27
+
data/lib/generator.rb ADDED
@@ -0,0 +1,31 @@
1
+ module JekyllGithubRepos
2
+ class Generator < Jekyll::Generator
3
+ safe true
4
+ priority :high
5
+
6
+ def generate(site)
7
+ client = Octokit::Client.new(access_token: site.config['github_repos']['access_token'])
8
+ repos = client.repos(site.config['github_repos']['username'])
9
+
10
+ repo_list = repos.map do |repo|
11
+ {
12
+ 'name' => repo.name,
13
+ 'full_name' => repo.full_name,
14
+ 'url' => repo.html_url,
15
+ 'desc' => repo.description,
16
+ 'created_at' => repo.created_at,
17
+ 'pushed_at' => repo.pushed_at,
18
+ 'updated_at' => repo.updated_at,
19
+ 'homepage' => repo.homepage,
20
+ 'forks_count' => repo.forks_count,
21
+ 'stargazers_count' => repo.stargazers_count,
22
+ 'watchers_count' => repo.watchers_count,
23
+ 'forks' => repo.forks,
24
+ 'open_issues' => repo.open_issues,
25
+ 'watchers' => repo.watchers,
26
+ }
27
+ end
28
+ site.data['github_repos'] = repo_list
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "jekyll"
4
+ require "octokit"
5
+ require "generator"
6
+
7
+ module JekyllGithubRepos
8
+ end
data/lib/version.rb ADDED
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Prevent bundler errors
4
+ module Liquid; class Tag; end; end
5
+
6
+ module Jekyll
7
+ class GitHubReposVersion < Liquid::Tag
8
+ VERSION = '0.0.1'
9
+ end
10
+ end
metadata ADDED
@@ -0,0 +1,97 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: jekyll-github-repos
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Midhun Devasia
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2023-07-23 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: jekyll
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '3.7'
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '5.0'
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: '3.7'
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '5.0'
33
+ - !ruby/object:Gem::Dependency
34
+ name: octokit
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: '5.6'
40
+ type: :runtime
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: '5.6'
47
+ - !ruby/object:Gem::Dependency
48
+ name: bundler
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - "~>"
52
+ - !ruby/object:Gem::Version
53
+ version: '1.15'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - "~>"
59
+ - !ruby/object:Gem::Version
60
+ version: '1.15'
61
+ description: A Jekyll plugin to fetch and list GitHub repositories in Liquid templates
62
+ email: hello@midhundev.asia
63
+ executables: []
64
+ extensions: []
65
+ extra_rdoc_files: []
66
+ files:
67
+ - License
68
+ - README.md
69
+ - jekyll-github-repos.gemspec
70
+ - lib/generator.rb
71
+ - lib/jekyll-github-repos.rb
72
+ - lib/version.rb
73
+ homepage: https://github.com/midhundevasia/jekyll-github-repos
74
+ licenses:
75
+ - MIT
76
+ metadata:
77
+ allowed_push_host: https://rubygems.org
78
+ post_install_message:
79
+ rdoc_options: []
80
+ require_paths:
81
+ - lib
82
+ required_ruby_version: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - ">="
85
+ - !ruby/object:Gem::Version
86
+ version: '0'
87
+ required_rubygems_version: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - ">="
90
+ - !ruby/object:Gem::Version
91
+ version: '0'
92
+ requirements: []
93
+ rubygems_version: 3.1.6
94
+ signing_key:
95
+ specification_version: 4
96
+ summary: Jekyll plugin to fetch and list GitHub repositories
97
+ test_files: []