I’m generating my site by using data files to define the content. Something like the following.
data.people.each do |person|
proxy "/#{person.slug}.html", "/person.html", locals: { person: person }
end
The problem with this approach is that when I change my data files, though the files are automatically reloaded, the change isn’t reflected. This is because the routes are only ever defined at boot time (or if I change config.rb
). So if I was to define a new person, a new route for them wouldn’t be created. Also, changes to existing data aren’t reflected either (as the local references a stale hash).
If anyone else has encountered this, do you have any recommendations?