dreverri / gollum-site

Static Site Generator for Gollum Wikis
254 stars 28 forks source link

adding optional ability to preserve the original wiki directory structure #32

Closed tylerflint closed 11 years ago

tylerflint commented 11 years ago

So it started as a bug and ended as a feature...

I realized that if I had created a file in a subdirectory named the same as a file in the root dir or perhaps another subdirectory that only one of them would end up as the html file. It has to do with how site.rb stores the wiki pages in a hash rather than a list. Since the key wasn't factoring directory uniqueness, whichever was inserted last was the winner. Regardless of the optional feature I added (explained later) I would still consider this a bug. The only implication (the reason I didn't fix it completely) was because there appears to be a hard dependency for markup and how it generates link classes. Since I'm not fully aware of the implications, I decided to leave that bug exposed unless the --preserve flag was passed as an arg.

Which brings us to the feature... I realized that by default, gollum-site will take any wiki pages in any sub directories and create them as html files in a single document root directory. I tend to like subdirectories for clean organization so I added a "--preserve" flag as an option which will re-create the html files preserving the original directory structure. This is optional, and the default behavior remains. All tests are passing.

Thanks