First try for #174, needs more thinking though, see issue.
This commit is contained in:
parent
66dbad9b72
commit
39270bd788
10
src/Utils.hs
10
src/Utils.hs
@ -27,6 +27,7 @@ import Utils.PathPiece as Utils
|
|||||||
|
|
||||||
import Text.Blaze (Markup, ToMarkup)
|
import Text.Blaze (Markup, ToMarkup)
|
||||||
|
|
||||||
|
import Control.Lens
|
||||||
import Data.Set (Set)
|
import Data.Set (Set)
|
||||||
import qualified Data.Set as Set
|
import qualified Data.Set as Set
|
||||||
import Data.Map (Map)
|
import Data.Map (Map)
|
||||||
@ -174,6 +175,15 @@ trd3 (_,_,z) = z
|
|||||||
|
|
||||||
-- notNull = not . null
|
-- notNull = not . null
|
||||||
|
|
||||||
|
lastMaybe :: [a] -> Maybe a
|
||||||
|
lastMaybe [] = Nothing
|
||||||
|
lastMaybe [h] = Just h
|
||||||
|
lastMaybe (_:t) = lastMaybe t
|
||||||
|
|
||||||
|
lastMaybe' :: [a] -> Maybe a
|
||||||
|
lastMaybe' l = fmap snd $ l ^? _Snoc
|
||||||
|
|
||||||
|
|
||||||
mergeAttrs :: [(Text, Text)] -> [(Text, Text)] -> [(Text, Text)]
|
mergeAttrs :: [(Text, Text)] -> [(Text, Text)] -> [(Text, Text)]
|
||||||
mergeAttrs = mergeAttrs' `on` sort
|
mergeAttrs = mergeAttrs' `on` sort
|
||||||
where
|
where
|
||||||
|
|||||||
@ -15,6 +15,8 @@
|
|||||||
<div .main__content-body>
|
<div .main__content-body>
|
||||||
|
|
||||||
<h1>
|
<h1>
|
||||||
|
$maybe back <- lastMaybe parents
|
||||||
|
<a .breadcrumbs__link href="@{fst back}">#{snd back}
|
||||||
$maybe headline <- contentHeadline
|
$maybe headline <- contentHeadline
|
||||||
^{headline}
|
^{headline}
|
||||||
$nothing
|
$nothing
|
||||||
|
|||||||
@ -7,9 +7,6 @@ $if hasPageActions
|
|||||||
$of PageActionPrime (MenuItem label _mIcon route _callback)
|
$of PageActionPrime (MenuItem label _mIcon route _callback)
|
||||||
<li .pagenav__list-item>
|
<li .pagenav__list-item>
|
||||||
<a .pagenav__link-wrapper href=@{route}>#{label}
|
<a .pagenav__link-wrapper href=@{route}>#{label}
|
||||||
$of _
|
|
||||||
$forall menuType <- menuTypes
|
|
||||||
$case menuType
|
|
||||||
$of PageActionSecondary (MenuItem label _mIcon route _callback)
|
$of PageActionSecondary (MenuItem label _mIcon route _callback)
|
||||||
<li .pagenav__list-item>
|
<li .pagenav__list-item>
|
||||||
<a .pagenav__link-wrapper href=@{route}>#{label}
|
<a .pagenav__link-wrapper href=@{route}>#{label}
|
||||||
|
|||||||
Reference in New Issue
Block a user