diff --git a/TODO b/TODO index 6344ee1..0ff2463 100644 --- a/TODO +++ b/TODO @@ -1,10 +1,14 @@ +Fix compile errors from setting up the groundwork for rss and section css shenanigans so I can do the rss feed now + +Clean up the + make the date format ISO (Markdown seems fine, just need typst)? make typst dependant on yaml? add template variable(s) for what "section" we're in -add description attr +make it so typst citation section has a header and/or is a div elem instead of a section element github action for deploy to github pages diff --git a/app/Main.hs b/app/Main.hs index 67804ba..4f79e79 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -160,6 +160,7 @@ rss = outputDir "index.xml" %> \target -> do postPaths <- getPublishedPosts posts <- sortOn (Ord.Down . postDate) <$> forM postPaths readPost + -- TODO: change this to actually have it's own type for things like updated applyTemplateAndWrite "feed.xml" (HM.singleton "posts" posts) target Shake.putInfo $ "Built " <> target diff --git a/app/Types.hs b/app/Types.hs index 823e7b8..038efa6 100644 --- a/app/Types.hs +++ b/app/Types.hs @@ -4,7 +4,8 @@ import Data.Text (Text) import Deriving.Aeson import Deriving.Aeson.Stock (PrefixedSnake) -data Page = Page {pageTitle :: Text, pageContent :: Text} +-- pageSection is what css class should be specified in a style html element, I would do an enum but I foresee that being a mistake +data Page = Page {pageTitle :: Text, pageContent :: Text, pageNow :: Text, pageSection :: Text} deriving (Show, Generic) deriving (ToJSON) via PrefixedSnake "page" Page @@ -16,7 +17,9 @@ data RenderedPost = RenderedPost rPostDate :: Maybe Text, rPostIsoDate :: Maybe Text, rPostContent :: Maybe Text, - rPostLink :: Maybe Text + rPostLink :: Maybe Text, + rPostSummary :: Maybe Text, + rPostId :: Text } deriving (Show, Generic) deriving (FromJSON, ToJSON) via PrefixedSnake "rPost" RenderedPost @@ -28,6 +31,7 @@ data Post = Post postDate :: Maybe Text, postContent :: Maybe Text, postLink :: Maybe Text, + postSummary :: Maybe Text, postDraft :: Maybe Bool } deriving (Show, Generic) diff --git a/app/Utilities.hs b/app/Utilities.hs index 43b879f..1e2b74a 100644 --- a/app/Utilities.hs +++ b/app/Utilities.hs @@ -161,4 +161,5 @@ getPublishedPosts = do parseDate :: Text -> Maybe Text parseDate str = do date <- parseTimeM False defaultTimeLocale "%Y-%-m-%-d" $ T.unpack str - return $ T.pack $ formatTime @UTCTime defaultTimeLocale "%Y-%m-%d" date + -- need to append the time to avoid potential issues + return $ T.pack $ formatTime @UTCTime defaultTimeLocale "%Y-%m-%dT00:00:00Z" date