 
 		res.locals.buildCssPath = (cssFile, opts)->
 			path = Path.join("/stylesheets/", cssFile)
-			if opts?.hashedPath
+			if opts?.hashedPath && hashedFiles[path]?
 				hashedPath = hashedFiles[path]
 				return Url.resolve(staticFilesBase, hashedPath)
 			return Url.resolve(staticFilesBase, path)

	"/stylesheets/ol-style.css"
]

for path in pathList
	content = getFileContent(path)
	hash = crypto.createHash("md5").update(content).digest("hex")
	
	splitPath = path.split("/")
	filenameSplit = splitPath.pop().split(".")
	filenameSplit.splice(filenameSplit.length-1, 0, hash)
	splitPath.push(filenameSplit.join("."))

	hashPath = splitPath.join("/")
	hashedFiles[path] = hashPath

	fsHashPath = Path.join __dirname, "../../../", "public#{hashPath}"
	fs.writeFileSync(fsHashPath, content)


logger.log "Finished hashing static content"

cdnAvailable = Settings.cdn?.web?.host?
darkCdnAvailable = Settings.cdn?.web?.darkHost?

		res.locals.buildJsPath = (jsFile, opts = {})->
			path = Path.join(jsPath, jsFile)

			if opts.hashedPath && hashedFiles[path]?
				path = hashedFiles[path]

			if !opts.qs?
