projects
/
blog.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b085109
)
Tweaks
author
Luke Lau
<luke_lau@icloud.com>
Wed, 10 Oct 2018 23:03:29 +0000
(
00:03
+0100)
committer
Luke Lau
<luke_lau@icloud.com>
Wed, 10 Oct 2018 23:03:29 +0000
(
00:03
+0100)
Main.hs
patch
|
blob
|
history
diff --git
a/Main.hs
b/Main.hs
index e6f0aaec3661f7531abfa05407eefb5f559830fe..f3a7472085479ec5555524fd133ac0146fb210eb 100644
(file)
--- a/
Main.hs
+++ b/
Main.hs
@@
-74,12
+74,12
@@
main = do
if authed
then template "Create" $ do
h1_ "Create a new post"
if authed
then template "Create" $ do
h1_ "Create a new post"
-
with
form_ [action_ "create", method_ "post"] $ do
+ form_ [action_ "create", method_ "post"] $ do
input_ [name_ "title", type_ "text", placeholder_ "Title"]
br_ []
input_ [name_ "title", type_ "text", placeholder_ "Title"]
br_ []
-
with
textarea_ [name_ "body", placeholder_ "# Your markdown here"] ""
+ textarea_ [name_ "body", placeholder_ "# Your markdown here"] ""
br_ []
br_ []
- input_ [type_ "submit"]
+ input_ [type_ "submit"
, value_ "Post"
]
else status unauthorized401
post "/create" $ do
else status unauthorized401
post "/create" $ do
@@
-128,13
+128,13
@@
template title content = do
a_ [href_ "/"] "🏠 Cool Blog"
if authed
then do
a_ [href_ "/"] "🏠 Cool Blog"
if authed
then do
- a_ [href_ "/create"] "Create a Post"
-
with
form_ [action_ "/logout", method_ "post", class_ "login-form"] $
+
" " >>
a_ [href_ "/create"] "Create a Post"
+ form_ [action_ "/logout", method_ "post", class_ "login-form"] $
input_ [type_ "submit", value_ "Log Out"]
input_ [type_ "submit", value_ "Log Out"]
- else
with
form_ [action_ "/login", method_ "post", class_ "login-form"] $ do
+ else form_ [action_ "/login", method_ "post", class_ "login-form"] $ do
input_ [name_ "username", placeholder_ "Username", type_ "text"]
input_ [name_ "password", placeholder_ "Password", type_ "password"]
input_ [name_ "username", placeholder_ "Username", type_ "text"]
input_ [name_ "password", placeholder_ "Password", type_ "password"]
- input_ [type_ "submit"]
+ input_ [type_ "submit"
, value_ "Log In"
]
content
where style = link_ [Attribute "rel" "stylesheet", Attribute "href" "/style.css"]
content
where style = link_ [Attribute "rel" "stylesheet", Attribute "href" "/style.css"]
@@
-156,12
+156,12
@@
render p@(Post markdown title date author) =
case M.parse (pathToPost p) (T.toStrict markdown) of
Left e -> Nothing
Right doc -> Just $
case M.parse (pathToPost p) (T.toStrict markdown) of
Left e -> Nothing
Right doc -> Just $
-
with
article_ [id_ (T.toStrict title)] $ do
+ article_ [id_ (T.toStrict title)] $ do
header_ $ do
header_ $ do
-
with
a_ [href_ (T.toStrict $ linkToPost p)] $
+ a_ [href_ (T.toStrict $ linkToPost p)] $
h1_ $ toHtml title
address_ $ "By " >> toHtml author
h1_ $ toHtml title
address_ $ "By " >> toHtml author
-
with
time_ [datetime_ (T.toStrict $ T.pack (show date))] $ toHtml dateStr
+ time_ [datetime_ (T.toStrict $ T.pack (show date))] $ toHtml dateStr
M.render (M.useExtensions extensions doc)
where extensions = [M.ghcSyntaxHighlighter, M.skylighting, M.footnotes]
dateStr = T.pack $ formatTime defaultTimeLocale "%a %e %B %Y" date
M.render (M.useExtensions extensions doc)
where extensions = [M.ghcSyntaxHighlighter, M.skylighting, M.footnotes]
dateStr = T.pack $ formatTime defaultTimeLocale "%a %e %B %Y" date