如何将CSS插入Warp / blaze应用程序?

时间:2019-04-03 07:46:07

标签: html css haskell warp wai

我有这两个代码文件,它们工作正常。它将在服务器3000上部署HTML页面:

Main.hs

{-# LANGUAGE OverloadedStrings #-}

module Main where

import Network.Wai
import Network.Wai.Handler.Warp
import Network.HTTP.Types
import Text.Blaze.Renderer.Utf8
import Index

main :: IO ()
main = run 3000 edgenode

edgenode :: Application
edgenode req resp = resp $ responseBuilder
    status200
    [("Content-Type", "text/html")]
    (renderMarkupBuilder index)

Index.hs

{-# LANGUAGE OverloadedStrings #-}

module Index where

import Prelude                       hiding (id, div, head)
import Text.Blaze
import Text.Blaze.Html5              hiding (main)
import Text.Blaze.Html5.Attributes

index :: Markup
index = docTypeHtml $ html $ do
    body $ div ! id "toolbar" $ do
        a ! class_ "std" ! href "#" $ "ABOUT"
        a ! class_ "std" ! href "#" $ "NEWS"
        a ! class_ "std" ! href "#" $ "LEGAL"
        a ! class_ "std" ! href "#" $ "PARTNERSHIP"
        a ! class_ "std" ! href "#" $ "LEGAL"
        a ! id "exp" ! href "#" $ "EXPLORE"

我想在其中添加一些CSS,但是标准的建议似乎并没有奏效:

link ! rel "stylesheet" ! type_ "text/css" ! href "screen.css"

有人有什么建议吗?

0 个答案:

没有答案