Path blog/test/index.html proxies to unknown file blogpost.html.slim

I’m having trouble doing the following Blog setup for Contentful and Middleman:

My code in config.ru looks like:

if @app.data.try(:home).try(:blog_post)
  data.home.blog_post.each do |_id, post|
    date = post.published_at
    path = "blog/#{post.slug}/index.html"
    template = "blogpost.html.slim"
    proxy path, template, locals: { post: post }
  end
end

And I keep getting, yet the file exists:

== The Middleman is loading
/Users/wizard/.rvm/gems/ruby-2.3.3/gems/middleman-core-4.3.3/lib/middleman-core/sitemap/extensions/proxies.rb:89:in `target_resource’: Path blog/test/index.html proxies to unknown file blogpost.html.slim:[“apply/refinance.html”, “apply/online-application.html”, “apply/purchase.html”, “client-checklist.html”, “privacy-policy.html”, “faq.html”, “quotes/refinance.html”, “quotes/get-quote.html”, “quotes/purchase.html”, “images/pin.png”, “images/trustworthy-mortgage-logo-white.png”, “images/testimonials/dean.jpg”, “images/loading.gif”, “images/.keep”, “images/trustworthy-mortgage-logo.png”, “images/mediaelement/controls.fw.png”, “images/mediaelement/loading.gif”, “images/mediaelement/background.png”, “images/mediaelement/bigplay.fw.png”, “images/mediaelement/controls.svg”, “images/mediaelement/bigplay.png”, “images/mediaelement/skipback.png”, “images/mediaelement/controls.png”, “images/mediaelement/bigplay.svg”, “images/hero_image_1.jpg”, “images/hero_image_3.jpg”, “images/home_loan.jpg”, “images/team/placeholder-circle-team-photo.jpg”, “images/team/placeholder-team-photo.jpg”, “images/hero_image_2.jpg”, “images/icons/faviconx57.png”, “images/icons/favicon.png”, “images/icons/faviconx72.png”, “images/hero_image_4.jpg”, “images/revslider/bullet.png”, “images/revslider/navigdots_bgtile.png”, “images/revslider/arrow_right.png”, “images/revslider/boxed_bgtile.png”, “images/revslider/navigdots.png”, “images/revslider/arrowright.png”, “images/revslider/arrow_right2.png”, “images/revslider/small_right.png”, “images/revslider/arrow_left.png”, “images/revslider/loader2.gif”, “images/revslider/gridtile_3x3_white.png”, “images/revslider/gridtile.png”, “images/revslider/arrows.psd”, “images/revslider/timerdot.png”, “images/revslider/large_right.png”, “images/revslider/black50.png”, “images/revslider/arrow_large_left.png”, “images/revslider/bullets.psd”, “images/revslider/small_left.png”, “images/revslider/bullets.png”, “images/revslider/bullets2.png”, “images/revslider/coloredbg.png”, “images/revslider/small_left_boxed.png”, “images/revslider/small_arrows.psd”, “images/revslider/bullet_boxed.png”, “images/revslider/gridtile_3x3.png”, “images/revslider/loader.gif”, “images/revslider/timer.png”, “images/revslider/arrowleft.png”, “images/revslider/arrow_large_right.png”, “images/revslider/arrow_left2.png”, “images/revslider/small_right_boxed.png”, “images/revslider/grain.png”, “images/revslider/shadow1.png”, “images/revslider/shadow2.png”, “images/revslider/large_left.png”, “images/revslider/shadow3.png”, “images/revslider/transparent.png”, “images/revslider/white50.png”, “images/revslider/transparent.jpg”, “images/revslider/gridtile_white.png”, “images/company-logos/company-logo.jpg”, “blog.html”, “calculator.html”, “glossary.html”, “blogpost.html”, “index.html”, “loan-team.html”, “terms-of-use.html”, “contact.html”, “javascripts/isotope.pkgd.min.js”, “javascripts/jquery.vmap.sampledata.js”, “javascripts/jquery.backstretch.min.js”, “javascripts/smoothscroll.js”, “javascripts/jquery.lavalamp.min.js”, “javascripts/jquery.vmap.world.js”, “javascripts/waypoints.js”, “javascripts/mediaelement-and-player.js”, “javascripts/waypoints-sticky.js”, “javascripts/mediaelement-and-player.min.js”, “javascripts/jquery.validate.min.js”, “javascripts/jquery.magnific-popup.min.js”, “javascripts/queryloader2.min.js”, “javascripts/jquery.debouncedresize.js”, “javascripts/sticky.js”, “javascripts/wow.js”, “javascripts/jflickrfeed.min.js”, “javascripts/retina.min.js”, “javascripts/jquery.vmap.min.js”, “javascripts/jquery.nicescroll.js”, “javascripts/typed.js”, “javascripts/jquery.themepunch.revolution.min.js”, “javascripts/jquery.magnific-popup.js”, “javascripts/jquery.themepunch.revolution.js”, “javascripts/jquery.nicescroll.min.js”, “javascripts/jquery.countTo.js”, “javascripts/wow.min.js”, “javascripts/owl.carousel.js”, “javascripts/waypoints.min.js”, “javascripts/jquery.min.js”, “javascripts/main.js”, “javascripts/jquery.lavalamp.js”, “javascripts/owl.carousel.min.js”, “javascripts/jquery.infinitescroll.min.js”, “javascripts/jquery.bootstrap-touchspin.min.js”, “javascripts/bootstrap.min.js”, “javascripts/jquery.knob.min.js”, “javascripts/jquery.mb.YTPlayer.js”, “javascripts/contact.js”, “javascripts/jquery.elevateZoom.min.js”, “javascripts/skrollr.min.js”, “javascripts/typed.min.js”, “javascripts/jquery.selectbox.min.js”, “javascripts/jquery.kwicks.min.js”, “javascripts/jquery.themepunch.tools.min.js”, “javascripts/jquery.nouislider.min.js”, “javascripts/jquery.knob.js”, “javascripts/jquery.hoverIntent.min.js”, “javascripts/modernizr.js”, “javascripts/waypoints-sticky.min.js”, “javascripts/jquery.bootstrap-touchspin.js”, “javascripts/skrollr.js”, “files/TMC_1_Percent_Down_UWM_Flyer.pdf”, “files/TMC_VA Mortgage_Product_Flagstar_Flyer.pdf”, “files/TMC_Gift_Funds_UWM_Flyer.pdf”, “files/TMC_HomeReady_Flagstar_Flyer.pdf”, “files/TMC_FHA_Cashout_Flagstar_Flyer.pdf”, “loan-process.html”, “fonts/fontawesome-webfont.svg”, “fonts/FontAwesome.otf”, “fonts/glyphicons-halflings-regular.woff”, “fonts/glyphicons-halflings-regular.eot”, “fonts/revicons.eot”, “fonts/glyphicons-halflings-regular.woff2”, “fonts/Simple-Line-Icons.svg”, “fonts/glyphicons-halflings-regular.ttf”, “fonts/fontawesome-webfont.woff2”, “fonts/revicons.ttf”, “fonts/Simple-Line-Icons.woff”, “fonts/Simple-Line-Icons.dev.svg”, “fonts/fontawesome-webfont.ttf”, “fonts/Simple-Line-Icons.eot”, “fonts/fontawesome-webfont.woff”, “fonts/glyphicons-halflings-regular.svg”, “fonts/revicons.woff”, “fonts/revicons.svg”, “fonts/fontawesome-webfont.eot”, “fonts/Simple-Line-Icons.ttf”, “careers.html”, “partials/office_information”, “partials/latest_news”, “partials/reviews.html”, “partials/why_choose_us”, “partials/hero”, “partials/map”, “partials/more_about_us”, “partials/our_products.html”, “stylesheets/bootstrap.min.css”, “stylesheets/magnific-popup.css”, “stylesheets/bootstrap.css”, “stylesheets/bootstrap-datetimepicker.css”, “stylesheets/skins/lightfonts.css”, “stylesheets/animate.css”, “stylesheets/mediaelementplayer.css”, “stylesheets/custom.css”, “stylesheets/simple-line-icons.css”, “stylesheets/colors/darkblue.css”, “stylesheets/jquery.selectbox.css”, “stylesheets/style.css”, “stylesheets/font-awesome.css”, “stylesheets/font-awesome.min.css”, “stylesheets/bootstrap-datetimepicker.min.css”, “stylesheets/vspacing.css”, “stylesheets/vspacing.min.css”, “stylesheets/revslider/revslider-index10.css”, “stylesheets/jquery.kwicks.css”, “stylesheets/YTPlayer.css”, “blog/test/index.html”, “blog//index.html”] (RuntimeError)

Can anyone help?

Pretty sure that code belongs in config.rb. Don’t know if it actually makes a difference though.
There might be errors in your blogpost.html.slim file, if it exists at all that is, that make your build fail. Can you share your repo?

Sorry, I meant it’s in config.rb.

The answer ended up being, set the template file to “.html”, even though it’s .slim. That solved it.