From 869f2c25d8b20a875a2d8d3c1287804dd17208ea Mon Sep 17 00:00:00 2001 From: Holger Just Date: Mon, 14 Dec 2015 15:34:59 +0100 Subject: [PATCH] Ignore draft articles and their associated images --- config.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/config.rb b/config.rb index 6a1ab4a..6ffcad8 100644 --- a/config.rb +++ b/config.rb @@ -124,6 +124,16 @@ page '/sitemap.xml', layout: false ignore '/partials/*' +# Ignore draft articles and their associated images +drafts_dir = File.expand_path('../source/drafts', __FILE__) +ignore '/drafts/*' +Dir["#{drafts_dir}/*/*"].each do |draft| + draft_article = draft + .sub(/\A#{Regexp.escape drafts_dir}\//, '') + .sub(/\.[^\/]+\z/, '') + ignore "/images/#{draft_article}/*" +end + ready do blog.tags.each do |tag, articles| proxy "/tag/#{tag.downcase.parameterize}/feed.xml", '/feed.xml', layout: false do