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
Import all files with .CSV in folder? #144
Comments
I guess you can do this: require 'jekyll-import'
Dir['*.csv'].each do |name|
JekyllImport::Importers::CSV.run "file" => name
end |
Leave out the initial forward slash: Dir['csv/*.csv'] |
Great, thanks a tone for your help! You seem really knowledgable about Jekyll and Ruby. May I ask if you have any suggestions for speeding up Jekyll's post generation? I'm importing about 1,000 - 2,000 posts into Jekyll and each time I make some modification to posts, I have to regenerate the whole site. It takes about 30 minutes right now. I'm planning to increase the posts later on and at this rate, it will take a few hours to many hours in the future. Any ideas on methods I can speed up the post generation? Thanks |
You're most welcomed. That's a tricky issue. Some folks suggested incremental regeneration (#380). If you are adding new posts, and are trying to preview these new posts, you can use the |
I won't really be adding individual posts, it's more like people write a lot of content and I upload them in one go after a few days. Will --limit-posts will help in this case? Also does Jekyll use as much system resource as available? e.g. will increasing my VPS's memory and CPU have a noticeable improvement. |
Yes, I am not too sure whether Jekyll will use all available system resource - my site has less than 100 posts, building it takes less than a minute. My guess is that there will be improvements, but not a lot as the bottleneck here is I/O. |
I see, so --limit_posts is more useful for previewing the site, but to really build and serve the site, I still need to run 'jekyll serve' or 'jekyll build' right, which takes quite a long time. Okay no problem, thanks again for the great help you've been providing. If this was Stackoverflow, I'd really upvote your comments and answers :) |
Hello
In the following default CSV import code:
require 'rubygems'
require "jekyll-import"
JekyllImport::Importers::CSV.run({
"file" => "myfile.csv"
})
There is the option of specifying a single CSV file. Is it possible to have the script import all files with .CSV in current folder? I have quite a few CSV files and they change names quite often.
Thanks
The text was updated successfully, but these errors were encountered: