generatePermalink js helper & code for generating the blog subdomain