jekyll-meta
A lightweight Jekyll plugin that injects useful build-time metadata (Jekyll version, environment, Ruby version, etc.) into Liquid templates.
Features
- Jekyll Version:
site.meta.jekyll_version - Major Version:
site.meta.jekyll_major_version(integer) - Environment:
site.meta.environment(e.g.,development,production) - Ruby Version:
site.meta.ruby_version
Installation
- Add to your Gemfile:
group :jekyll_plugins do
gem "jekyll-meta"
end
- Bundle install:
bundle install
- Enable the plugin in your
_config.yml:
plugins:
- jekyll-meta
- Rebuild your site:
bundle exec jekyll build
Usage
Use the following Liquid variables anywhere in your templates, pages, or posts:
Jekyll version: {{ site.meta.jekyll_version }}
Major version: {{ site.meta.jekyll_major_version }}
Environment: {{ site.meta.environment }}
Ruby version: {{ site.meta.ruby_version }}
Example
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>{{ site.title }}</title>
</head>
<body>
<footer>
<p>Built with Jekyll v{{ site.meta.jekyll_version }} (v{{ site.meta.jekyll_major_version }})</p>
<p>Environment: {{ site.meta.environment }}</p>
<p>Ruby: {{ site.meta.ruby_version }}</p>
</footer>
</body>
</html>
Configuration
No additional configuration is required. The plugin works out of the box once enabled.
Compatibility
- Jekyll:
>= 3.0,< 5.0 - Ruby:
>= 2.7
Contributing
Contributions, issues, and feature requests are welcome!
- Fork the repository
- Create your feature branch (
git checkout -b feature/my-feature) - Commit your changes (
git commit -m 'Add some feature') - Push to the branch (
git push origin feature/my-feature) - Open a pull request
Please ensure all tests pass and follow the existing code style.
License
Licensed under the MIT License. See LICENSE for details.
Links
- Homepage: https://github.com/PrimerPages/jekyll-meta
- RubyGems: https://rubygems.org/gems/jekyll-meta