Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jekyll-prep

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jekyll-prep

  • 0.0.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Jekyll::Prep

Prepare Jekyll page data using Ruby.

Installation

See Jekyll's documentation for installing Jekyll plugins.

Usage

  1. Create a _prep directory in your Jekyll project.
  2. Inside the _prep directory, create .rb files that correspond to your .md Jekyll pages. For example, if you have a /people/jill.md Jekyll page then create a _prep/people/jill.rb file.
  3. Inside the .rb files, define subclasses of Jekyll::Prep::Script that define a prepare method that will receive an instance of Jekyll::Page. The subclass namespaces must align with the .rb file paths minus the leading underscore. For example, the file _prep/people/jill.rb should contain Prep::People::Jill.
  4. Inside the prepare methods, do whatever you want to page.data.
# _prep/people/jill.rb

module Prep
  module People
    class Jill < Jekyll::Prep::Script

      def prepare(page)
        page.data['something new'] = 'was added during prep'
      end

    end
  end
end

Contributing

  1. Fork it (https://github.com/gregoryjscott/jekyll-prep/fork).
  2. Create your feature branch (git checkout -b my-new-feature).
  3. Commit your changes (git commit -am 'Add some feature').
  4. Push to the branch (git push origin my-new-feature).
  5. Create a new Pull Request.

FAQs

Package last updated on 28 Nov 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc