I am creating a semi static site in middleman. I have created json local data. With my current setup i get File Not Found when using link_to
= link_to f.name, "speakers/#{f._id}.html"
My url looks like
http://0.0.0.0:4567/speakers/53d544ea13dccbaf24521d98.html
speaker.yml
{
"people": [
{
"_id": "53d544ea13dccbaf24521d98",
"index": 0,
"status": false,
"profile_pic": "https://res.cloudinary.com/upload/v140671888/duncan_jnow.jpg",
"name": "Duncan Nieves",
"company": "QOT",
"position": "CFO",
"email": "duncannieves@qot.com",
"phone": "+33 (933) 598-3714",
"address": "813 Franklin Avenue",
"city": "Grantville",
"country": "Cyprus",
"biography": "Et reprehenderit aute adipisicing nostrud aliquip anim velit est ullamco non aliquip. Amet pariatur quis non dolor cupidatat nostrud enim sint ullamco occaecat. Reprehenderit est sint id est incididunt.\r\n",
"registered": "2014-02-27T15:40:41 -01:00",
}
]
}
Then looping through the data
.section
.event-speakers
- data.speaker.people.take(12).each do |f|
.speaker.mobile-6.tablet-3.medium-2.large-2{itemscope: '', itemtype: 'http://data-vocabulary.org/Person'}
= link_to "speakers/#{f._id}.html" do
= image_tag f.profile_pic, width: '165'
%span.speaker-name{itemprop: 'name'}
= link_to f.name, "speakers/#{f._id}.html"
%span.job-title{itemprop: 'title'}
= f.position
%span.job-company{itempro: 'affiliation'}
= link_to f.company, "#", target: '_blank'
When i try to add the following i get the same results.
data.speaker.people.each do |f|
proxy "/speakers/#{f[:_id]}.html", "speakers/layout.html",
:locals => { :f => f }
end
I get the data but i can’t figure out how to link to a single person. How do i define the template? Where do i place the template. Do i need to define some routes somewhere?