From e50152d3d1102ee4d50d4c5dbc4de35597ec7661 Mon Sep 17 00:00:00 2001 From: Anna Wiggins Date: Sat, 24 Dec 2016 17:26:51 -0500 Subject: [PATCH] Include original markdown files in build output. --- _plugins/markdown_and_sign.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 _plugins/markdown_and_sign.rb 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