         else
           host = hostname
 
-        settings.get 'sites', host
+        github.get_site host
 
       default: -> settings.get 'default'
+      get_site: (name) -> settings.get 'sites', name ? settings.get 'default'
 
       get_repo_contents: (url) ->
         http.get(url)

            url = github.to_api_url site, "/repos/#{user}/#{repo}/contents/#{segments.join '/'}", {ref}

      save_gist: (gist, options={}) ->
        github_host = options.github ? github.default()
        gh = settings.get 'sites', github_host
        http.post github.to_api_url(gh, '/gists'), gist

      to_api_url: (site, path, params={}) ->
        result = URI("#{site.api_base_url}#{path}").setQuery(params)

          github.to_api_url site, "/gists/#{id}"
        gist = gist.toString()
        if gist.indexOf('http') != 0
          site = github.get_site()
          build_url site, gist
        else
          site = github.get_site_from_url gist
