pageUrl added

This commit is contained in:
Pagwin 2025-02-23 18:05:41 -05:00
parent 52d88c95a7
commit 4d45ab4bd5
No known key found for this signature in database
GPG key ID: 81137023740CA260
2 changed files with 4 additions and 6 deletions

View file

@ -11,7 +11,6 @@ import Config
import Control.Monad (forM, when) import Control.Monad (forM, when)
import qualified Data.HashMap.Strict as HM import qualified Data.HashMap.Strict as HM
import Data.List (sortOn) import Data.List (sortOn)
import Data.Maybe (fromJust)
import qualified Data.Ord as Ord import qualified Data.Ord as Ord
import qualified Data.Text as T import qualified Data.Text as T
import Deriving.Aeson import Deriving.Aeson
@ -20,7 +19,6 @@ import Development.Shake (Action, Rules, (%>), (|%>), (~>))
import qualified Development.Shake as Shake import qualified Development.Shake as Shake
import Development.Shake.FilePath ((</>)) import Development.Shake.FilePath ((</>))
import qualified Development.Shake.FilePath as FP import qualified Development.Shake.FilePath as FP
import qualified Development.Shake.FilePath as Shake
import Templates import Templates
import Types import Types
import Utilities import Utilities
@ -104,7 +102,7 @@ markdownPost src = do
{ pageTitle = rPostTitle rPost, { pageTitle = rPostTitle rPost,
pageContent = postHtml, pageContent = postHtml,
pageNow = time, pageNow = time,
pageSection = T.pack $ fromJust $ Shake.stripExtension "html" target pageUrl = T.pack ""
} }
applyTemplateAndWrite "default.html" page target applyTemplateAndWrite "default.html" page target
@ -125,7 +123,7 @@ home =
{ pageTitle = T.pack "Home", { pageTitle = T.pack "Home",
pageContent = html, pageContent = html,
pageNow = time, pageNow = time,
pageSection = T.pack $ fromJust $ Shake.stripExtension "html" target pageUrl = T.pack ""
} }
applyTemplateAndWrite "default.html" page target applyTemplateAndWrite "default.html" page target

View file

@ -10,8 +10,8 @@ data Page = Page
pageContent :: Text, pageContent :: Text,
-- build time -- build time
pageNow :: Text, pageNow :: Text,
-- css class for page section --
pageSection :: Text pageUrl :: Text
} }
deriving (Show, Generic) deriving (Show, Generic)
deriving (ToJSON) via PrefixedSnake "page" Page deriving (ToJSON) via PrefixedSnake "page" Page