Class: JekyllCommandTemplate
- Inherits:
-
Jekyll::Command
- Object
- Jekyll::Command
- JekyllCommandTemplate
- Defined in:
- jekyll_command_template.rb
Overview
Template for Jekyll command plugins. Once you create a command plugin from this template, mention it in a Gemfile group called :jekyll_plugins, like this: group :jekyll_plugins do gem "my_command_template" end
Class Method Summary collapse
Class Method Details
.init_with_program(prog) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'jekyll_command_template.rb', line 18 def init_with_program(prog) @log.info "prog [#{prog.class}] = #{prog}".green prog.command(:new) do |c| c.syntax 'new [options]' c.description 'Create a new Jekyll site.' c.option 'dest', '-d DEST', 'Where the site should go.' c.action do |args, | @log.info "args [#{args.class}] = #{args}".green @log.info "options [#{.class}] = #{}".green Jekyll::Site.new_site_at(['dest']) end end end |