jekyll-meta

RubyGem Version Build status

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

  1. Add to your Gemfile:
   group :jekyll_plugins do
     gem "jekyll-meta"
   end
  1. Bundle install:
   bundle install
  1. Enable the plugin in your _config.yml:
   plugins:
     - jekyll-meta
  1. 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!

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/my-feature)
  3. Commit your changes (git commit -m 'Add some feature')
  4. Push to the branch (git push origin feature/my-feature)
  5. 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.