Apparently proxies need a file, not a path

Tom Rutgers committed Aug 18, 2018
commit 25e5a20570b575fdd4a027e1af60f7b0e1f581e5
Showing 2 changed files with 8 additions and 2 deletions
config.rb +7 -1
@@ @@ -43,13 +43,19 @@ end
# https://middlemanapp.com/advanced/dynamic-pages/
data.products.each do |product|
- proxy "/products/#{product[1].title.parameterize}.html", "/product.html", locals: {product: product[1]}, layout: 'layout', :ignore => true
+ proxy "/products/#{product[1][:title].parameterize}/index.html", "product.html",
+ locals: {product: product[1]},
+ layout: 'layout',
+ ignore: true
end
# Helpers
# Methods defined in the helpers block are available in templates
# https://middlemanapp.com/basics/helper-methods/
+ # pretty urls
+ activate :directory_indexes
+
helpers do
def background_image(image)
"background-image: url('" << image_path(image) << "')"
source/partials/products/_product.slim +1 -1
@@ @@ -1,6 +1,6 @@
//link to product by converting the title to a slug
.product
- = link_to '/products/' + product.title.parameterize + '.html'
+ = link_to '/products/' + product.title.parameterize + '/'
.product-image
= image_tag product.image
.product-content