module IHP.Assets.ViewFunctions
( assetPath
, assetVersion
) where
import IHP.Prelude
import IHP.Controller.Context
import qualified IHP.FrameworkConfig as Config
assetPath :: (?context :: ControllerContext) => Text -> Text
assetPath :: (?context::ControllerContext) => Text -> Text
assetPath Text
assetPath = Text
baseUrl Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
assetPath Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
"?v=" Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
(?context::ControllerContext) => Text
assetVersion
where
baseUrl :: Text
baseUrl = Text -> Maybe Text -> Text
forall a. a -> Maybe a -> a
fromMaybe Text
"" ?context::ControllerContext
ControllerContext
?context.frameworkConfig.assetBaseUrl
{-# INLINABLE assetPath #-}
assetVersion :: (?context :: ControllerContext) => Text
assetVersion :: (?context::ControllerContext) => Text
assetVersion = ?context::ControllerContext
ControllerContext
?context.frameworkConfig.assetVersion
{-# INLINABLE assetVersion #-}