Permalink
Browse files

RSS: add "tag" option to add a tag to all posts (#306)

Merge pull request 306
  • Loading branch information...
sergiocarracedo authored and jekyllbot committed Nov 6, 2017
1 parent 0c2e063 commit 58a8395404b3baa51df15523c260277d04d8a3af
Showing with 4 additions and 0 deletions.
  1. +1 −0 .gitignore
  2. +3 −0 lib/jekyll-import/importers/rss.rb
@@ -21,3 +21,4 @@ doc/

.DS_Store
Gemfile.lock

@@ -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|

0 comments on commit 58a8395

Please sign in to comment.