docpad / docpad-plugin-dateurls

DocPad plugin that adds support for date based URLs to DocPad

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Original files still generated

ervwalter opened this issue · comments

When using this plugin, say I have this file:

/documents/posts/2012-10-21-my-blog-post.html.md

With a appropriate metadata:


---
name: my blog post
date: 2012-10-21

---

Docpad correctly generates a file for http://yoursite.com/2012/10/21/my-blog-post.html, but http://yoursite.com/posts/2012-10-21-my-blog-post.html is also still generated.

Was the this is by design? If so, would you be opposed to an pull request for an option to conditionally clear out any existing urls before adding the date urls?

In my project, I want only the date-in-the-path files to be generated.

After further investigation, it seems that creating the original file path is pretty hard-wired into docpad and there is not much that can be done to avoid it. Perhaps the only reasonable option is to do what the cleanurls plugin does and write some meta refresh content into the original file path so that the browser at least gets bounced to the correct URL...

Thoughts?

@balupton do you know of a way to not generate the normal post files?

For my particular purpose, I have a reasonable workaround, so the existing behavior is no longer triggering perfectionist-related anxiety for me :)

I just adjusted my deployment script to ignore the 'posts' folder entirely when copying statically generated content to the web host since there is never anything in there that matters with how I am using the dateurls plugin.

Thanks