Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ build:
cp -v $(my_wasm) public/

prerender:
nix develop --command bash -c "cabal run prerender"
nix develop --command bash -c "cabal update && cabal run prerender"

optim:
wasm-opt -all -O2 public/app.wasm -o public/app.wasm
Expand Down
12 changes: 11 additions & 1 deletion cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@ allow-newer:
source-repository-package
type: git
location: https://github.com/dmjio/miso
tag: 8c4b85e6e1279bec9b66859c54f25209701b8153
tag: d45d0e9a5a17d40f44f78e18784d6eb38e8785d3

source-repository-package
type: git
location: https://github.com/haskell-miso/servant-miso-router
tag: de7afbaf14511e0fdaca7f6da832a11d8c13118d

source-repository-package
type: git
location: https://github.com/haskell-miso/servant-miso-html
tag: 00781d1920795b67e0476b67ed6840c388f29810

flags: +template-haskell
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions haskell-miso.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ executable prerender
aeson,
base < 5,
bytestring,
servant-miso-router,
miso,
mtl,
servant,
Expand All @@ -87,6 +88,7 @@ executable app
base < 5,
containers,
miso,
servant-miso-router,
mtl,
servant,
default-language:
Expand Down
79 changes: 40 additions & 39 deletions server/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,15 @@ import Common
import Control.Monad (forM_)
import Data.Aeson (ToJSON, encodeFile)
import qualified Data.ByteString.Lazy.Char8 as BL8
import Data.Text (Text)
import qualified Data.Text as T
import qualified Data.Text.IO as T
import GHC.Generics (Generic)
import Servant.API
-----------------------------------------------------------------------------
import Miso hiding (run)
import Miso.String
import qualified Miso.Html.Element as Html
import Miso.Html
import qualified Miso.Html.Element as H
import qualified Miso.Html.Property as P
-----------------------------------------------------------------------------
#ifdef WASM
foreign export javascript "hs_start" main :: IO ()
Expand Down Expand Up @@ -91,45 +92,45 @@ instance ToHtml Page where
toHtml (Page x) =
toHtml
[ doctype_
, html_
[ lang_ "en"
, H.html_
[ P.lang_ "en"
]
[ head_
[ H.head_
[]
[ Html.title_ [] [ "Miso: A tasty Haskell web and mobile framework"]
, link_
[ rel_ "stylesheet"
, href_ "https://cdnjs.cloudflare.com/ajax/libs/github-fork-ribbon-css/0.2.2/gh-fork-ribbon.min.css"
[ H.title_ [] [ "Miso: A tasty Haskell web and mobile framework"]
, H.link_
[ P.rel_ "stylesheet"
, P.href_ "https://cdnjs.cloudflare.com/ajax/libs/github-fork-ribbon-css/0.2.2/gh-fork-ribbon.min.css"
]
, link_
[ rel_ "manifest"
, href_ "/manifest.json"
, H.link_
[ P.rel_ "manifest"
, P.href_ "/manifest.json"
]
, link_
[ rel_ "icon"
, href_ "/favicon.ico"
, type_ "image/x-icon"
, H.link_
[ P.rel_ "icon"
, P.href_ "/favicon.ico"
, P.type_ "image/x-icon"
]
, meta_
[ charset_ "utf-8"
, H.meta_
[ P.charset_ "utf-8"
]
, meta_
[ name_ "theme-color"
, content_ "#00d1b2"
, H.meta_
[ P.name_ "theme-color"
, P.content_ "#00d1b2"
]
, meta_
[ httpEquiv_ "X-UA-Compatible"
, content_ "IE=edge"
, H.meta_
[ P.httpEquiv_ "X-UA-Compatible"
, P.content_ "IE=edge"
]
, meta_
[ name_ "viewport"
, content_ "width=device-width, initial-scale=1"
, H.meta_
[ P.name_ "viewport"
, P.content_ "width=device-width, initial-scale=1"
]
, meta_
[ name_ "description"
, content_ "Miso is a Haskell web and mobile framework"
, H.meta_
[ P.name_ "description"
, P.content_ "Miso is a Haskell web and mobile framework"
]
, style_ [] ".github-fork-ribbon:before { background-color: \"#e59751\" !important; } "
, H.style_ [] ".github-fork-ribbon:before { background-color: \"#e59751\" !important; } "
, cssRef animateRef
, cssRef bulmaRef
, cssRef fontAwesomeRef
Expand All @@ -143,16 +144,16 @@ instance ToHtml Page where
where
jsRef href =
script_
[ src_ href
, async_ "true"
, defer_ "true"
, type_ "module"
[ P.src_ href
, P.async_ "true"
, P.defer_ "true"
, P.type_ "module"
] mempty
cssRef href =
link_
[ rel_ "stylesheet"
, type_ "text/css"
, href_ href
[ P.rel_ "stylesheet"
, P.type_ "text/css"
, P.href_ href
]
-----------------------------------------------------------------------------
fontAwesomeRef :: MisoString
Expand Down
Loading