Class: Builders::VercelUrl

Inherits:
SiteBuilder
  • Object
show all
Defined in:
bridgetown-core/lib/bridgetown-core/configurations/vercel/vercel_url.rb

Instance Method Summary collapse

Instance Method Details

#buildObject



4
5
6
7
8
9
10
11
# File 'bridgetown-core/lib/bridgetown-core/configurations/vercel/vercel_url.rb', line 4

def build
  hook :site, :pre_render do |site|
    next unless ENV["VERCEL_URL"] && ENV["VERCEL_ENV"] != "production"

    Bridgetown.logger.info("Subbing Vercel URL")
    site.config.update(url: "https://#{ENV["VERCEL_URL"]}")
  end
end