Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Nebelhorn
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software
Nebelhorn
Commits
dd110e00
Commit
dd110e00
authored
1 year ago
by
Nicolas Lenz
Browse files
Options
Downloads
Patches
Plain Diff
don't set isActive for a category on indices
parent
b4c5bdb0
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#2533
passed
1 year ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Build.hs
+2
-7
2 additions, 7 deletions
src/Build.hs
with
2 additions
and
7 deletions
src/Build.hs
+
2
−
7
View file @
dd110e00
...
...
@@ -153,18 +153,13 @@ putIsActive page@Page{..} = page { pageDoc = addMeta "isActive" isActiveMeta pag
Nothing
->
MetaMap
Map
.
empty
Just
category
->
MetaMap
$
Map
.
singleton
category
$
MetaBool
True
-- isActive.category.foo is true for pages that have the category foo
, and for pages that are an index for foo
-- isActive.category.foo is true for pages that have the category foo
isActiveMetaCategory
::
MetaValue
isActiveMetaCategory
=
MetaMap
$
insertIndex
$
fromList
$
map
helper
pageCategories
where
isActiveMetaCategory
=
MetaMap
$
fromList
$
map
helper
pageCategories
where
helper
::
Text
->
(
Text
,
MetaValue
)
helper
category
=
(
category
,
MetaMap
$
Map
.
singleton
category
$
MetaBool
True
)
insertIndex
::
Map
Text
MetaValue
->
Map
Text
MetaValue
insertIndex
meta
=
case
indexFor
page
of
Nothing
->
meta
Just
category
->
Map
.
insert
category
(
MetaBool
True
)
meta
-- isActive.page.foo is true if the current page has the slug foo
isActiveMetaPage
::
MetaValue
isActiveMetaPage
=
let
Pandoc
meta
_
=
pageDoc
in
case
lookupMetaPlain
"slug"
meta
of
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment