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 Control.Lens
|
||||
import Data.Set (Set)
|
||||
import qualified Data.Set as Set
|
||||
import Data.Map (Map)
|
||||
@ -174,6 +175,15 @@ trd3 (_,_,z) = z
|
||||
|
||||
-- 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 = mergeAttrs' `on` sort
|
||||
where
|
||||
|
||||
@ -15,6 +15,8 @@
|
||||
<div .main__content-body>
|
||||
|
||||
<h1>
|
||||
$maybe back <- lastMaybe parents
|
||||
<a .breadcrumbs__link href="@{fst back}">#{snd back}
|
||||
$maybe headline <- contentHeadline
|
||||
^{headline}
|
||||
$nothing
|
||||
|
||||
@ -7,9 +7,6 @@ $if hasPageActions
|
||||
$of PageActionPrime (MenuItem label _mIcon route _callback)
|
||||
<li .pagenav__list-item>
|
||||
<a .pagenav__link-wrapper href=@{route}>#{label}
|
||||
$of _
|
||||
$forall menuType <- menuTypes
|
||||
$case menuType
|
||||
$of PageActionSecondary (MenuItem label _mIcon route _callback)
|
||||
<li .pagenav__list-item>
|
||||
<a .pagenav__link-wrapper href=@{route}>#{label}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user