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

`jekyll new`: scaffold site generator #764

Merged
merged 24 commits into from Mar 17, 2013

Conversation

Projects
None yet
7 participants
@parkr
Copy link
Member

parkr commented Jan 17, 2013

This PR adds a new subcommand, new, which creates a scaffold site in a specified path, based on the design of @mojombo's site. When I met with Tom, he expressed the wish to have a command like this create a "substantial" site - not just a couple directories and a blank index file. The point of these files is to provide assistance to a newcomer. There's been a lot of talk about being newbie-friendly, and this PR hopes to help with that. From no-jekyll to full-jekyll, a newcomer would just execute:

~/code$ gem install jekyll
~/code$ jekyll new blog && cd blog
~/code/blog$ jekyll serve # Navigate to http://localhost:4000
                          # to view your new site!

Let me know if there are more files that should be provided with the basic scaffold or if content should be added/reworded in or removed from these files to provide a better scaffold for users.

To-Do:

  • Add tests for Jekyll::Commands::New
  • Remove Related Posts from site template
  • Add example of code snippets to sample post.

Considering:

  • --blank or --bare option, which would just throw blank files and empty directories in the specified directory instead of providing the helpful content
  • Adding paths explicitly to _config.yml so there's no confusion about what's what (source, destination, etc)
  • Using erb's to generate new files (with path as site name, like Rails) instead of programmatically generating whatever we can

@parkr parkr referenced this pull request Jan 17, 2013

Closed

jekyll new #748

@mojombo

This comment has been minimized.

Copy link
Contributor

mojombo commented Jan 17, 2013

This is a great start. Exactly what I was looking for!

@parkr

This comment has been minimized.

Copy link
Member Author

parkr commented Jan 17, 2013

@mojombo What else would you like to see for jekyll new? Generators for individual pages & posts will be jekyll generate.

@ThomasWunderlich

This comment has been minimized.

Copy link

ThomasWunderlich commented Jan 18, 2013

Hey, just jumping in, I'd love to write tests for this feature if you don't mind.

I love the idea of running those two commands and just letting a user start writing

@parkr

This comment has been minimized.

Copy link
Member Author

parkr commented Jan 18, 2013

Sure, submit a working PR to this branch! Or post them as comments and I'll add them and give you credit in the git log.

@mojombo

This comment has been minimized.

Copy link
Contributor

mojombo commented Jan 21, 2013

  • Right now the Related Posts area is empty because there's only one post. We should probably just remove that from the post layout.
  • It would be nice to see an example of syntax highlighted code in the example post. This is an incredibly common usecase for Jekyll and sample usage might better help people understand how to use it.
@parkr

This comment has been minimized.

Copy link
Member Author

parkr commented Jan 27, 2013

Thinking that maybe I should be using an .erb file for that post... thoughts, @mojombo?

@mojombo

This comment has been minimized.

Copy link
Contributor

mojombo commented Jan 30, 2013

@parkr Yeah, I'm not a huge fan of having so much content in the code as strings. I think moving it to an erb or similar would be great.

@mattr-

This comment has been minimized.

Typo. Should be [Jekyll docs] instead of [Jeyll docs]

@mattr-

This comment has been minimized.

https://github.com/mojombo/jekyll for the actual URL here. 😄

@mattr-

This comment has been minimized.

Copy link
Member

mattr- commented on lib/jekyll/commands/new.rb in 272dd5e Jan 31, 2013

Shouldn't we be using safe_yaml here?

This comment has been minimized.

Copy link
Member Author

parkr replied Jan 31, 2013

Urgh, maybe. Isn't safe_yaml a patch for yaml, but not the whole lib?

This comment has been minimized.

Copy link
Member

mattr- replied Jan 31, 2013

@ghost ghost assigned mojombo Feb 12, 2013

@parkr

This comment has been minimized.

Copy link
Member Author

parkr commented Feb 23, 2013

@mojombo We're not currently testing any of the other commands (build/serve/import) - might be a good idea to start?

@danielgrieve

This comment has been minimized.

Copy link
Contributor

danielgrieve commented Feb 26, 2013

How can I submit a pull request to this pull request? I have some commits for this feature that you may want to merge in. I'm writing tests around this command in a fork (https://github.com/danielgrieve/jekyll/tree/jekyll-new).

@parkr

This comment has been minimized.

Copy link
Member Author

parkr commented Feb 27, 2013

When you submit a pull request, there is an option at the top to submit it against a branch other than master (a drop-down menu). Submit it against mojombo/jekyll-new.

@danielgrieve

This comment has been minimized.

Copy link
Contributor

danielgrieve commented Feb 27, 2013

I submitted pull request #825 which adds some tests around this

parkr and others added some commits Mar 12, 2013

Merge pull request #851 from jroes/jekyll-new
Make `jekyll new` work when installed via `gem install`
@danielgrieve

This comment has been minimized.

Copy link
Contributor

danielgrieve commented Mar 13, 2013

I appreciate the tests being pulled over to this different implementation. However, as you can see the travis build broke (due to the safe_yaml gem being outdated in this branch).

Do you want me to update the tests or the implementation? As you can see some of the tests will fail with this implementation, the first example is an exception won't be raised if no arguments are provided. The other is that this implementation still has the same problem with doing FileUtils.cp_r on a glob of files (file duplication).

If you can let me know which way you'd like to go then I can update it accordingly. Still not 100% sure what was wrong with the implementation I had altered before.

@danielgrieve

This comment has been minimized.

Copy link
Contributor

danielgrieve commented Mar 13, 2013

OK so I've altered both tests + implementation slightly in #856

Hopefully this will keep everyone happy :)

Daniel Grieve and others added some commits Mar 13, 2013

Daniel Grieve
Merge pull request #856 from danielgrieve/jekyll-new
Jekyll 'new' command fixes
@mojombo

This comment has been minimized.

Copy link
Contributor

mojombo commented Mar 17, 2013

This looks great. I'd love to get this in master so we can try it out more easily and keep iterating where necessary.

@parkr

This comment has been minimized.

Copy link
Member Author

parkr commented Mar 17, 2013

I'll rebase and merge!

parkr added a commit that referenced this pull request Mar 17, 2013

Merge pull request #764 from mojombo/jekyll-new
`jekyll new`: scaffold site generator

@parkr parkr merged commit e2d0697 into master Mar 17, 2013

@parkr parkr deleted the jekyll-new branch Mar 17, 2013

parkr added a commit that referenced this pull request Mar 17, 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.