First try for #174, needs more thinking though, see issue.

This commit is contained in:
SJost 2018-09-06 17:06:36 +02:00
parent 66dbad9b72
commit 39270bd788
3 changed files with 12 additions and 3 deletions

View File

@ -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

View File

@ -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

View File

@ -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}