ruhoh / ruhoh.rb

http://ruhoh.com
616 stars 69 forks source link

RSS and pagination URLs not clean #263

Open waynedpj opened 10 years ago

waynedpj commented 10 years ago

i have been researching this awhile and i apologize in advance for not coming up with a pull request, but my programming/Ruby skills are severely lacking and i wanted to document what i believe to be a bug while i have it in my brain's "front matter" ;)

i believe that i have discovered a possible bug: given a collection with a directory name like to do (note the spaces) and containing an index.html the resulting URL of the pagination files/folder (i.e. index, etc.) and rss.xml files generated by Ruhoh will still contain the space, though the actual collection contents will have the correct URL:

to-do/
└── index.html
to do/
├── index
│   └── 1
│       └── index.html
└── rss.xml

i have tracked the problem down to here for RSS and here for pagination though i cannot discover where the config['url'] is being set. i was temporarily able to fix the problem for RSS by wrapping the config['url'[ in Ruhoh::StringFormat.clean_slug_and_escape but i think it needs to be applied earlier since config['url'] is already returning the uncleaned URL before the actual file is created. unfortunately i have been unable to determine this spot yet.

thanks in advance for any pointers on how i can fix this and make a pull request.

peace