diff --git a/.gitignore b/.gitignore index 7393ff41..aa5b105a 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,4 @@ doc/ .DS_Store Gemfile.lock + diff --git a/lib/jekyll-import/importers/rss.rb b/lib/jekyll-import/importers/rss.rb index 86851d7e..ad2d1b90 100644 --- a/lib/jekyll-import/importers/rss.rb +++ b/lib/jekyll-import/importers/rss.rb @@ -3,6 +3,7 @@ module Importers class RSS < Importer def self.specify_options(c) c.option "source", "--source NAME", "The RSS file or URL to import" + c.option "tag", "--tag NAME", "Add a tag to posts" end def self.validate(options) @@ -48,6 +49,8 @@ def self.process(options) "title" => item.title, } + header["tag"] = options["tag"] if !options.to_s.empty? + FileUtils.mkdir_p("_posts") File.open("_posts/#{name}.html", "w") do |f|