class Maglev::GetBaseUrl
In the preview mode, we need the maglev root path.
Get the url used to build the URLs of the pages.
def call
def call preview_mode? ? site_preview_path : live_url end
def live_url
def live_url return nil if context.controller.request.nil? context.controller.request.base_url end
def preview_mode?
def preview_mode? preview_mode.nil? ? context.rendering_mode == :editor : preview_mode end
def site_preview_path
def site_preview_path context.controller.site_preview_path end