0.0
The project is in a healthy, maintained state
Custom StaticFile descendants for Jekyll.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 13.3
~> 3.13
~> 0.22.0

Runtime

~> 4.3
 Project Readme
EN ru

is-static-files

GitHub License Gem Version Ruby Coverage

Custom StaticFile descendants for Jekyll.

Overview

is-static-files is a Ruby gem that extends Jekyll's static file handling capabilities by providing a custom StaticFile class. It allows you to manage static files that either come from a source file or from dynamic content held directly in memory. This flexibility enables programmatically generating or modifying static file content during the Jekyll build process.

Features

  • Inherits from Jekyll::StaticFile to seamlessly integrate with Jekyll.
  • Supports files backed by an existing source file on disk.
  • Supports files created from raw content data without existing source files.
  • Custom destination and relative path handling.
  • Compatible with Jekyll >= 4.3 and Ruby ~> 3.4.
  • Comes with RSpec tests and SimpleCov coverage for easy maintenance.

Installation

Add this line to your Jekyll site's Gemfile:

gem 'is-static-files', '~> 0.8.0'

And then execute:

bundle install

Or install it yourself as:

gem install is-static-files

Usage

Create instances of IS::StaticFile to represent static files that you want Jekyll to include in the site build.

# From existing source file
file = IS::StaticFile.new(site, '/target/path/', 'example.txt', source: '/full/path/to/src/example.txt')

# From in-memory content with no source file
file2 = IS::StaticFile.new(site, '/target/path/', 'generated.txt', content: 'This is dynamic content.')

# Add these files to the site static files during a generator hook
site.static_files << file
site.static_files << file2

The write method ensures files are copied or written to the destination directory during site generation.

Development and Testing

Clone the repository and run:

bundle install
rake spec

This will run the RSpec test suite with coverage reporting.

License

This project is licensed under the GPL-3.0-or-later License.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/jekyll-is/is-static-files.


Crafted for Jekyll users needing advanced static file handling with dynamic content generation.