Move Accept HTML in Yore.Servant

This commit is contained in:
Paul Brinkmeier
2025-09-22 19:04:51 +02:00
parent f2a136d27c
commit 0bf734730b
3 changed files with 12 additions and 12 deletions
+2 -9
View File
@@ -19,12 +19,10 @@ import Data.Proxy (Proxy (..))
import Data.Text (Text)
import Data.Time (Day, LocalTime (..), TimeOfDay (..), ZonedTime (..), addDays, toGregorian)
import GHC.Generics (Generic)
import Network.HTTP.Media ((//), (/:))
import Network.HTTP.Types (Status (..))
import Network.Wai (Request (..))
import Servant
( Accept (..)
, Capture
( Capture
, Get
, Handler
, MimeRender (..)
@@ -59,7 +57,7 @@ import Yore.Download (downloadInto)
import Yore.Error (Error (..))
import Yore.Schedule (schedule)
import Yore.Scrape (Issue (..), getIssuesByDay)
import Yore.Servant (GetSendfile, Sendfile (..))
import Yore.Servant (GetSendfile, HTML, Sendfile (..))
import Yore.Time (addYears, getCurrentDay, getSecondsUntilMidnight)
import qualified Envy
@@ -232,11 +230,6 @@ instance MimeRender HTML RootModel where
-- Utils
data HTML
instance Accept HTML where
contentType _ = "text" // "html" /: ("charset", "utf-8")
get100YearsAgo :: IO (Either Error Day)
get100YearsAgo = runExceptT $ getTodayWithOffset (-100) 0