Skip to content

Commit

Permalink
Try Jekyll Hook for 3rd party publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
mwunsch committed Jun 14, 2016
1 parent 4c557a6 commit 4aebf2f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions _plugins/publish_to_medium.rb
@@ -0,0 +1,13 @@
require 'jekyll'

Jekyll::Hooks.register :documents, :pre_render do |post|
if PublishToMedium.suitable?(post)
p post.data["slug"]
end
end

class PublishToMedium
def self.suitable?(post)
post.data["categories"].include?("tumblelog") && ["text", nil].include?(post.data["type"])
end
end

0 comments on commit 4aebf2f

Please sign in to comment.