Sha256: 22db2e331a3696fb168ca696b4c7614a68b4144818a434a1149bd10d040acf97
Contents?: true
Size: 605 Bytes
Versions: 24
Compression:
Stored size: 605 Bytes
Contents
# frozen_string_literal: true module Maglev # Get the url used to build the URLs of the pages. # In the preview mode, we need the maglev root path. class GetBaseUrl include Injectable dependency :context dependency :fetch_site argument :preview_mode, default: nil def call preview_mode? ? site_preview_path : live_url end private def preview_mode? preview_mode.nil? ? context.rendering_mode == :editor : preview_mode end def site_preview_path context.controller.site_preview_path end def live_url nil end end end
Version data entries
24 entries across 24 versions & 1 rubygems