Commit 120e0f82 authored by Aral Balkan's avatar Aral Balkan
Browse files

Strip www. subdomain from site names

Related to #32
parent 91741657
......@@ -58,7 +58,15 @@ class Template
(if @siteTemplate? then (@renderStaticTemplate @siteTemplate, data) else @loadAndRenderSiteTemplateWithData data)
.then (instance) ->
if filePath isnt false
instance.saveToDraftsOrFilePath filePath, 'sites', data.hostname
# We save sites based on hostname so that we can have granular insight
# into subdomains, however, for simplicity we are going to assume the
# that the special (by convention) www. subdomain can be adequately
# represented by the naked domain.
siteName = data.hostname.replace /^www\./, ''
instance.saveToDraftsOrFilePath filePath, 'sites', siteName
else
Promise.resolve instance
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment