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

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

Merged
merged 4 commits into from
Nov 6, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Merge branch 'master' into master
  • Loading branch information
parkr committed Nov 6, 2017
commit 509055868dbf81697746200c35418aee3ae6f923
9 changes: 3 additions & 6 deletions lib/jekyll-import/importers/rss.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ module JekyllImport
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'
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)
Expand Down Expand Up @@ -49,10 +49,7 @@ def self.process(options)
"title" => item.title,
}

tag = options.fetch('tag', '')
if tag != ''
header['tag'] = tag;
end
header["tag"] = options["tag"] if !options.to_s.empty?

FileUtils.mkdir_p("_posts")

Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.