Hey All,
I’m trying to generate pages from some local data files and can’t seem to figure out what I’m doing wrong. This is for a new portfolio website I’m building and first time trying to use this feature.
The data file lives in /data/work.yml
and looks something like this (with more fields, but keeping it simple for now):
- name: Client 1
slug: client-1
- name: Client 2
slug: client-2
- name: Client 3
slug: client-3
My config.rb looks like this (from the thoughtbot middleman template):
activate :aria_current
activate :autoprefixer
set :css_dir, "assets/stylesheets"
set :fonts_dir, "assets/fonts"
set :images_dir, "assets/images"
set :js_dir, "assets/javascripts"
set :markdown,
autolink: true,
fenced_code_blocks: true,
footnotes: true,
highlight: true,
smartypants: true,
strikethrough: true,
tables: true,
with_toc_data: true
set :markdown_engine, :redcarpet
page "/*.json", layout: false
page "/*.txt", layout: false
page "/*.xml", layout: false
activate :meta_tags
activate :directory_indexes
data.work.each do |work|
proxy "/work/#{work.slug}/index.html", "/layouts/work.erb",
locals: { work_name: work }
end
configure :development do
activate :livereload do |reload|
reload.no_swf = true
end
end
configure :production do
activate :asset_hash
activate :gzip
activate :minify_css
activate :minify_html
activate :minify_javascript
end
Every time I try running middleman I get the following:
{redacted}/.rbenv/versions/2.4.3/lib/ruby/gems/2.4.0/gems/middleman-core-4.2.1/lib/middleman-core/sitemap/extensions/proxies.rb:89:in `target_resource': Path work/client-1/index.html proxies to unknown file layouts/work.erb:["assets/fonts/.keep", "assets/fonts/ionicons.eot", "assets/fonts/ionicons.svg", "assets/fonts/ionicons.ttf", "assets/fonts/ionicons.woff", {etc etc} (RuntimeError)
Can anyone lend a hand? Have been banging my head on this for a while : )