I’m tearing my hair out with this and hoping someone can help. I keep getting weird character encoding issues when using dashes in urls or files. e.g.
<% content_for :stylesheet do %>
<%= stylesheet_link_tag("gang-starr–battle.css") %>
<% end %>
Is actually output as…
http://0.0.0.0:4567/stylesheets/gang-starr–battle.css
So I’m getting 404 errors on my stylesheets.
The same thing with frontmatter and outputting navigation e.g. this
---
title: Gang Starr – Battle
player_color: e70000
track: gang starr battle
---
<% pages = sitemap.resources.find_all{|p| p.source_file.match(/\.html/)}.sort_by {|p| p.url} %>
<ul>
<% pages.each do |p| %>
<% if(p.data.title) %>
<li>
<%= link_to p.data.title, p.url.force_encoding(Encoding::UTF_8) %>
</li>
<% end %>
<% end %>
</ul>
Only works as I’m force encoding UTF8, if I take that out I get the same character encoding issues and the pages are not recognised.
I’ve tried forcing encoding at the top of my config.rb, and per erb file but no joy.
Using middleman 3.2.2 and ruby-2.0.0-p353