docpad / docpad-plugin-sitemap

Auto-generated sitemaps for DocPad
Other
10 stars 9 forks source link

DocPad crashes with "NoURLProtocolError: Protocol is required" after installing #5

Closed nfriedly closed 10 years ago

nfriedly commented 11 years ago

Not sure what's going on here. I tried adding my site URL to both plugins.sitemap.hostname and templateData.site.url, with and without "http://", and it doesn't seem to make a difference.

I tried running docpad run --debug, and that gets me debug output from docpad but not any plugins, but I think that's a bug in docpad.

Update: this was due to having the string 'http' in the path of one of my urls - the current sitemap.js release sees that and then fails to add the site protocol and hostname, and then chokes later when the URL doesn't have one.

nfriedly commented 11 years ago

It looks like this is due to a bug in sitemap.js - fixed in the above pull request. Please update whenever that gets merged in, or, if it doesn't then feel free to depend on my fork instead :)

nfriedly commented 11 years ago

Ok, sitemap is now fixed. Please update to version 0.7.1 (or newer) at your earliest convenience :)

Naatan commented 10 years ago

Still getting a similar error:

error: Something went wrong with the action error: An error occured: Protocol is required

nfriedly commented 10 years ago

Hum, I just updated my site to use the current version of docpad-plugin-sitemap instead of the one I had hacked together before the change got merged in, and it seems to work: http://nfriedly.com/sitemap.xml - code at https://github.com/nfriedly/nfriedly.com

Are you sure you're on the 2.2.0 release? Is your code online anywhere?

Naatan commented 10 years ago

Found the issue, my templateData.site.url was set to "/", as I don't like to force a domain. Replacing it with a full url fixes the issue, though it's not ideal.

Maybe the plugin should allow you to set the url in the plugin settings, rather than forcing the templateData entry.

Naatan commented 10 years ago

Upon further investigation it seems there is an undocumented sitemap.hostname config variable that does just this. All good now :)

nfriedly commented 10 years ago

Cool, I'm going to close this one then.