Responsive nav (molecule). On screen < M, it shows a hamburger in the top right which displays a full screen modal nav, and on screen > M it displays a one-line nav.
28 lines
734 B
Haskell
28 lines
734 B
Haskell
module Routes
|
|
( Route(..)
|
|
, path
|
|
) where
|
|
|
|
import GHC.Exts ( IsString(..) )
|
|
|
|
data Route = Home
|
|
| Blog
|
|
| Archive
|
|
| Post String
|
|
| Tag String
|
|
| Img String
|
|
| DefaultStylesheet
|
|
| ExternalRoute String
|
|
|
|
instance IsString Route where
|
|
fromString = ExternalRoute
|
|
|
|
path :: Route -> String
|
|
path Home = "/"
|
|
path Blog = "/posts"
|
|
path Archive = "/tags"
|
|
path (Post postId ) = "/posts/" <> postId
|
|
path (Tag tag ) = "/tags/#" <> tag
|
|
path (Img fileName) = "/assets/img/" <> fileName
|
|
path DefaultStylesheet = "/css/default.css"
|
|
path (ExternalRoute addr) = addr
|