Comments (4)
Will investigate.
from middleman-blog.
I can confirm that this doesn't work, but I'm afraid it's a flaw in the Ruby standard 'uri' library:
http://rawsyntax.com/blog/url-validation-in-rails-3-and-ruby-in-general/
Your best bet for now is to not use non-ASCII characters in filenames until this is fixed in Ruby 2.0. Watch this issue for progress: http://bugs.ruby-lang.org/issues/1787
I poked around as to how we could work around this, and it looks like the only place URI is used like this happens is within Rack::Test. I've filed an issue with them: rack/rack-test#56
However, there's another problem I'm encountering which is frankly stumping me. Paths with unicode characters get added to the sitemap hash, but then cannot be retrieved again, even though it's clearly there as a key! For example:
# The Sitemap::Store contains "2011/01/01/snowmen-rule-☃.html"
# @pages is a hash from path (String) => Middleman::Sitemap::Page
@pages.has_key("2011/01/01/snowmen-rule-☃.html")
=> false
@pages.keys.include?("2011/01/01/snowmen-rule-☃.html")
=> true
I can't seem to replicate this in IRB with just regular strings and hashes. I don't really know what's going on. This part is what's preventing these paths from being renderable even in the preview server.
from middleman-blog.
OK, it appears to be a bug in Ruby with a similar underlying cause as this (fixed) bug: http://www.ruby-forum.com/topic/179303 - both the strings appear identical, but have different hashcodes.
I haven't yet been able to create a repro, but I'll post something to the Ruby bugtracker when I do (and maybe it'll give a hint as to how we could work around it).
from middleman-blog.
I haven't been able to come up with a repro, though I suspect it's the filenames coming out of the listen gem. I have found a workaround, which is to call .tr('','')
on the path strings. However, that just uncovered other places where unicode paths don't work in Middleman - specifically, Rack receives the request (in PATH_INFO
) with unicode characters URI-encoded. To work around that we'd need to make sure paths are stored in the sitemap URI-encoded (probably by encoding them when the filesystem watcher sees them) which will of course make it complicated to reference those from config.rb
.
I'm also going to move this issue over to the main middleman issue tracker since this isn't specific to middleman-blog.
from middleman-blog.
Related Issues (20)
- Add more informations in head of article HOT 2
- Extension should not fail to activate if middleman-core/cli is missing
- Paging on untagged posts HOT 1
- How to make paginate work with localize blog? HOT 2
- Cyrillic tags stopped working in 4.0.2 HOT 2
- Support i18n mount_at_root option in permalinks HOT 3
- 4.0.2 regression bug when specifying the blog in the front-matter HOT 7
- feed.xml error on multi-blog site HOT 1
- RuntimeError flag --blog HOT 1
- 4.0.2 on RubyGems.org has different dependencies to the git repo HOT 3
- Very poor and outdated blog template which does not match with default template HOT 4
- Iterating through blog.tags spits out extraneous frontmatter HOT 5
- How to get links to all calendar/tag pages HOT 5
- Calendar and tag pages without .html aren't rendered within layout automatically HOT 1
- How to configure URLs of articles with underscore HOT 6
- `middleman article` generates incorrect yaml when the title contains characters that should be escaped HOT 1
- Middleman blog frontmatter evaluating files under build directory HOT 3
- preserve i18n locale on non-localized article page HOT 2
- YAML error on Ruby 3.1.0 HOT 7
- Paginate is showing as false even if set in config.rb to true HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from middleman-blog.