jekyll-meta 0.1.0
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 +7 -0
- data/LICENSE +21 -0
- data/README.md +102 -0
- data/lib/jekyll_meta/generator.rb +23 -0
- data/lib/jekyll_meta/version.rb +5 -0
- data/lib/jekyll_meta.rb +12 -0
- metadata +71 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 0fedfd67082faabd85570365617508e896c95186bbc4289a890a397d8b5ee4b9
|
4
|
+
data.tar.gz: 3e22006dda8ac277796f764f0d48034eba54851ed6b48e9aee04b3eb286b2891
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 8718ce98c7324661c5c58850febe85d502979f8bef498e0642636dcdcb4802abdc6528a2fecaab8382ebe165d0a8fd28d843e1f709264a33f5649291a15e0a50
|
7
|
+
data.tar.gz: 7ea50b506d97eb49c9db25eaa12bc334128b7cba119349da3b2df6505780225028bc19cba3ae00ee91697683a619845465c897e0c3a9513f5c8a509ee53dfccd
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2025 PrimerPages
|
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,102 @@
|
|
1
|
+
# jekyll-meta
|
2
|
+
|
3
|
+
[](https://badge.fury.io/rb/jekyll-meta)
|
4
|
+
[](https://github.com/PrimerPages/jekyll-meta/actions)
|
5
|
+
|
6
|
+
A lightweight Jekyll plugin that injects useful build-time metadata (Jekyll version, environment, Ruby version, etc.) into Liquid templates.
|
7
|
+
|
8
|
+
## Features
|
9
|
+
|
10
|
+
* **Jekyll Version**: `site.meta.jekyll_version`
|
11
|
+
* **Major Version**: `site.meta.jekyll_major_version` (integer)
|
12
|
+
* **Environment**: `site.meta.environment` (e.g., `development`, `production`)
|
13
|
+
* **Ruby Version**: `site.meta.ruby_version`
|
14
|
+
|
15
|
+
## Installation
|
16
|
+
|
17
|
+
1. **Add to your Gemfile**:
|
18
|
+
|
19
|
+
```ruby
|
20
|
+
group :jekyll_plugins do
|
21
|
+
gem "jekyll-meta"
|
22
|
+
end
|
23
|
+
```
|
24
|
+
|
25
|
+
2. **Bundle install**:
|
26
|
+
|
27
|
+
```sh
|
28
|
+
bundle install
|
29
|
+
```
|
30
|
+
|
31
|
+
3. **Enable the plugin** in your `_config.yml`:
|
32
|
+
|
33
|
+
```yaml
|
34
|
+
plugins:
|
35
|
+
- jekyll-meta
|
36
|
+
```
|
37
|
+
|
38
|
+
4. **Rebuild your site**:
|
39
|
+
|
40
|
+
```sh
|
41
|
+
bundle exec jekyll build
|
42
|
+
```
|
43
|
+
|
44
|
+
## Usage
|
45
|
+
|
46
|
+
Use the following Liquid variables anywhere in your templates, pages, or posts:
|
47
|
+
|
48
|
+
```liquid
|
49
|
+
Jekyll version: {{ site.meta.jekyll_version }}
|
50
|
+
Major version: {{ site.meta.jekyll_major_version }}
|
51
|
+
Environment: {{ site.meta.environment }}
|
52
|
+
Ruby version: {{ site.meta.ruby_version }}
|
53
|
+
```
|
54
|
+
|
55
|
+
### Example
|
56
|
+
|
57
|
+
```html
|
58
|
+
<!DOCTYPE html>
|
59
|
+
<html>
|
60
|
+
<head>
|
61
|
+
<meta charset="utf-8">
|
62
|
+
<title>{{ site.title }}</title>
|
63
|
+
</head>
|
64
|
+
<body>
|
65
|
+
<footer>
|
66
|
+
<p>Built with Jekyll v{{ site.meta.jekyll_version }} (v{{ site.meta.jekyll_major_version }})</p>
|
67
|
+
<p>Environment: {{ site.meta.environment }}</p>
|
68
|
+
<p>Ruby: {{ site.meta.ruby_version }}</p>
|
69
|
+
</footer>
|
70
|
+
</body>
|
71
|
+
</html>
|
72
|
+
```
|
73
|
+
|
74
|
+
## Configuration
|
75
|
+
|
76
|
+
No additional configuration is required. The plugin works out of the box once enabled.
|
77
|
+
|
78
|
+
## Compatibility
|
79
|
+
|
80
|
+
* **Jekyll**: `>= 3.0`, `< 5.0`
|
81
|
+
* **Ruby**: `>= 2.7`
|
82
|
+
|
83
|
+
## Contributing
|
84
|
+
|
85
|
+
Contributions, issues, and feature requests are welcome!
|
86
|
+
|
87
|
+
1. Fork the repository
|
88
|
+
2. Create your feature branch (`git checkout -b feature/my-feature`)
|
89
|
+
3. Commit your changes (`git commit -m 'Add some feature'`)
|
90
|
+
4. Push to the branch (`git push origin feature/my-feature`)
|
91
|
+
5. Open a pull request
|
92
|
+
|
93
|
+
Please ensure all tests pass and follow the existing code style.
|
94
|
+
|
95
|
+
## License
|
96
|
+
|
97
|
+
Licensed under the MIT License. See [LICENSE](LICENSE) for details.
|
98
|
+
|
99
|
+
## Links
|
100
|
+
|
101
|
+
* **Homepage:** [https://github.com/PrimerPages/jekyll-meta](https://github.com/PrimerPages/jekyll-meta)
|
102
|
+
* **RubyGems:** [https://rubygems.org/gems/jekyll-meta](https://rubygems.org/gems/jekyll-meta)
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module JekyllMeta
|
4
|
+
# A Jekyll plugin that injects build metadata into the site configuration.
|
5
|
+
#
|
6
|
+
# This generator runs with the highest priority and safely adds useful
|
7
|
+
# environment details—such as Jekyll version, Ruby version, and build
|
8
|
+
# environment—into `site.config['meta']` for later use in templates or plugins.
|
9
|
+
class Generator < Jekyll::Generator
|
10
|
+
safe true
|
11
|
+
priority :highest
|
12
|
+
|
13
|
+
def generate(site)
|
14
|
+
site.config['meta'] ||= {}
|
15
|
+
site.config['meta'].merge!(
|
16
|
+
'jekyll_version' => Jekyll::VERSION,
|
17
|
+
'jekyll_major_version' => Jekyll::VERSION.split('.').first.to_i,
|
18
|
+
'environment' => Jekyll.env,
|
19
|
+
'ruby_version' => RUBY_VERSION
|
20
|
+
)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
data/lib/jekyll_meta.rb
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'jekyll'
|
4
|
+
require_relative 'jekyll_meta/version'
|
5
|
+
require_relative 'jekyll_meta/generator'
|
6
|
+
|
7
|
+
# JekyllMeta is a Jekyll plugin that injects metadata about the build environment
|
8
|
+
# (Jekyll version, Ruby version, environment, etc.) into the site's configuration.
|
9
|
+
#
|
10
|
+
# This module acts as the namespace for the plugin components.
|
11
|
+
module JekyllMeta
|
12
|
+
end
|
metadata
ADDED
@@ -0,0 +1,71 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: jekyll-meta
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Allison Thackston
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2025-05-18 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.0'
|
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.0'
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '5.0'
|
33
|
+
description: A Jekyll plugin that injects metadata into the `site.meta` namespace.
|
34
|
+
email:
|
35
|
+
- allison@allisonthackston.com
|
36
|
+
executables: []
|
37
|
+
extensions: []
|
38
|
+
extra_rdoc_files: []
|
39
|
+
files:
|
40
|
+
- LICENSE
|
41
|
+
- README.md
|
42
|
+
- lib/jekyll_meta.rb
|
43
|
+
- lib/jekyll_meta/generator.rb
|
44
|
+
- lib/jekyll_meta/version.rb
|
45
|
+
homepage: https://github.com/PrimerPages/jekyll-meta
|
46
|
+
licenses:
|
47
|
+
- MIT
|
48
|
+
metadata:
|
49
|
+
source_code_uri: https://github.com/PrimerPages/jekyll-meta
|
50
|
+
bug_tracker_uri: https://github.com/PrimerPages/jekyll-meta/issues
|
51
|
+
rubygems_mfa_required: 'true'
|
52
|
+
post_install_message:
|
53
|
+
rdoc_options: []
|
54
|
+
require_paths:
|
55
|
+
- lib
|
56
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - ">="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '2.7'
|
61
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
62
|
+
requirements:
|
63
|
+
- - ">="
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: '0'
|
66
|
+
requirements: []
|
67
|
+
rubygems_version: 3.4.20
|
68
|
+
signing_key:
|
69
|
+
specification_version: 4
|
70
|
+
summary: Expose Jekyll version and build metadata to Liquid templates.
|
71
|
+
test_files: []
|