Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The Big Jekyll Command Cleanup #690

Merged
merged 22 commits into from Jan 12, 2013

Conversation

Projects
None yet
4 participants
@tombell
Copy link
Contributor

tombell commented Dec 16, 2012

So I've decided to dedicate some time to cleaning up the bin/jekyll binary.

This branch is pretty much finished.

Commands are more intuitive thanks to the useful help output. There are three distinct subcommands at the minute; build, serve and import.

Build

Builds the jekyll site, has some options:

  • -w, --watch will watch for changes and rebuild when they're detected
  • --lsi will build using LSI for improved related posts

Serve

Serves the built jekyll site, has some options:

Passed to the pre build command before serving

  • -w, --watch will watch for changes and rebuild when they're detected
  • --lsi will build using LSI for improved related posts

Passed to the serve command for serving

  • -p, --port port to listen on
  • -h, --host host to bind to
  • -b, --baseurl base URL

Import/Migrate

Imports blog posts from another platform using the migrators.

  • --file file to migrate from
  • --dbname database name to migrate from
  • --user user to use when migrating
  • --pass password to use when migrating
  • --host host address to use when migrating
@parkr

This comment has been minimized.

Copy link
Member

parkr commented Dec 18, 2012

I mentioned this on your Gist, but I wanted to chime in here as well.

How would the use of the Commander gem support multiple commands? For example, I often run both --auto and --server. With your configuration, I'd have to either run jekyll serve --auto or jekyll watch --serve.

It seems like modularizing commands in that way will cause confusion.

@tombell

This comment has been minimized.

Copy link
Contributor Author

tombell commented Dec 18, 2012

jekyll build --watch or jekyll serve --watch

To me the automatic rebuilding isn't a command it's an option of the building or serving. I updated my gist last night https://gist.github.com/4315072

tombell added some commits Dec 18, 2012

Add bin/jekyll2 and initial BuildCommand
The `BuildCommand` class is responsible for handling the building of the site.
It can also optionally watch for changes to files and regenerate the site if
needed.

The `Command` class holds any methods which are used by any command
implementation.
Add initial serve command
The `ServeCommand` will let you serve your site locally for development. You
can specify `--port`, `--host` and `--baseurl` options if you wish to change the
defaults.

Additionally the `BuildCommand` will be called before the processing of the
serve command, this makes sure that the site is actually built. This means you
are able to pass the `--watch` option to auto-regenerate your site, even while
serving it locally.
@@ -0,0 +1,14 @@
module Jekyll

class Command

This comment has been minimized.

Copy link
@parkr

parkr Dec 18, 2012

Member

Make sure you TomDoc that :)

This comment has been minimized.

Copy link
@tombell

tombell Dec 18, 2012

Author Contributor

I'm following by example... only certain methods in jekyll are actually TomDoc'd, not everything.

This comment has been minimized.

Copy link
@parkr

parkr Dec 22, 2012

Member

Tom mentioned that he wanted to TomDoc everything that's in the repo right now – he just hasn't gotten to it, yet.

@@ -0,0 +1,82 @@
module Jekyll

class BuildCommand < Command

This comment has been minimized.

Copy link
@parkr

parkr Dec 18, 2012

Member

All of these classes and methods, actually :)

Do you have a readme outlining the command structure and switches?

@parkr

This comment has been minimized.

Copy link
Member

parkr commented Dec 18, 2012

Nicely done!

@tombell

This comment has been minimized.

Copy link
Contributor Author

tombell commented Dec 19, 2012

Swapped over the bin/jekyll in features/support/env.rb to bin/jekyll2 build, and every still passes.

Now is the time to refine everything :shipit:

Remove command options from default config
Removing command line options from the config is a path towards cleaning up the
configuration file and not including options which don't really belong there.

@parkr parkr referenced this pull request Dec 22, 2012

Closed

Clean Up bin/jekyll #609

@parkr parkr referenced this pull request Jan 2, 2013

Closed

Jekyll Sub-commands #726

@parkr

This comment has been minimized.

Copy link
Member

parkr commented Jan 11, 2013

  • Put migrators back (we're splicing them out later)
  • Rename :migrate command to :import

tombell added some commits Jan 11, 2013

Revert "Remove migrators"
This reverts commit b9da30b.
@tombell

This comment has been minimized.

Copy link
Contributor Author

tombell commented Jan 11, 2013

Updated main PR comment with more details.

'source' => Dir.pwd,
'destination' => File.join(Dir.pwd, '_site'),

This comment has been minimized.

Copy link
@parkr
@@ -120,6 +119,9 @@ module Jekyll
#
# Returns the final configuration Hash.
def self.configuration(override)
# Convert any symbol keys to strings and remove the old key/values
override = override.reduce({}) { |hsh,(k,v)| hsh.merge(k.to_s => v) }

This comment has been minimized.

Copy link
@parkr

parkr Jan 11, 2013

Member

👍

@parkr

This comment has been minimized.

Copy link
Member

parkr commented Jan 11, 2013

Thanks for making those changes! One last thing is to write TomDocs for everything and I'll merge this in. Thanks :)

@parkr

This comment has been minimized.

Copy link
Member

parkr commented Jan 12, 2013

I can't automatically merge this - rebase on current master? Thanks @tombell! Merging this in once it's ready.

@mattr-

This comment has been minimized.

Copy link
Member

mattr- commented Jan 12, 2013

You could merge it manually, you know. That's how we did it back in the old
days. 😉

On Friday, January 11, 2013, Parker Moore wrote:

I can't automatically merge this - rebase on current master? Thanks
@tombell https://github.com/tombell! Merging this in once it's ready.


Reply to this email directly or view it on GitHubhttps://github.com//pull/690#issuecomment-12170726.

@parkr

This comment has been minimized.

Copy link
Member

parkr commented Jan 12, 2013

In the new days, we prefer GitHub's built-in merge functionality. 😉 But I get ya.

I'll merge this in tonight -- I'm not at my computer at the moment. Thanks for your hard work, @tombell!

@mattr-

This comment has been minimized.

Copy link
Member

mattr- commented Jan 12, 2013

No doubt. The GitHub built-in merge functionality is preferred. I was just giving you shit really. 😄

parkr added a commit that referenced this pull request Jan 12, 2013

Merge pull request #690 from tombell/jekyll-command-redux
The Big Jekyll Command Cleanup

@parkr parkr merged commit 14cabab into jekyll:master Jan 12, 2013

@ghost ghost assigned parkr Jan 12, 2013

@parkr

This comment has been minimized.

Copy link
Member

parkr commented Jan 12, 2013

Changing --auto to --watch is going to be confusing if the _config.yml files contain auto. Switch auto to watch in site configuration?

@mojombo, @qrush?

@parkr

This comment has been minimized.

Copy link
Member

parkr commented Jan 12, 2013

We should also consider removing the server switch from _config.yml.

@parkr

This comment has been minimized.

Copy link
Member

parkr commented Jan 12, 2013

I'm updating the docs and relevant options which were missed for build and serve. PR soon.

@tombell tombell deleted the tombell:jekyll-command-redux branch Jan 12, 2013

@jekyll jekyll locked and limited conversation to collaborators Feb 27, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.