diff --git a/_plugins/markdown_and_sign.rb b/_plugins/markdown_and_sign.rb new file mode 100644 index 0000000..939b5eb --- /dev/null +++ b/_plugins/markdown_and_sign.rb @@ -0,0 +1,11 @@ +# Copy all of the source markdown files directly into the destination. +Jekyll::Hooks.register :site, :post_write do |site| + dest = site.dest + categories = site.config['category_metadata'].each_key do |category| + dir = Dir.new("#{site.source}/_posts/#{category}") + dir.each do |filename| + next unless filename =~ /\.md$/ + FileUtils.cp("#{dir.path}/#{filename}", "#{dest}/#{category}/") + end + end +end