Skip to content

Commit 759b33b

Browse files
author
AQUINO SANCHEZ Jorge
committed
Add place njk and place in menu
1 parent 2aa1149 commit 759b33b

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

src/_layouts/main.njk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
</li>
5454
<!-- Lieux -->
5555
<li class="nav-item dropdown">
56-
<a class="nav-link" id="DropdownMenuLink_3" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false" data-i18n="lieux"></a>
56+
<a class="nav-link" id="DropdownMenuLink_3" href="{{ '/pages/fr/places' | relative(page) }}" role="button" aria-expanded="false" data-i18n="lieux"></a>
5757
</li>
5858
</ul>
5959
</li>

src/_layouts/place.njk

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---js
2+
{
3+
layout: "main.njk",
4+
pagination: {
5+
data: "places.graph",
6+
size: 1,
7+
alias: "place",
8+
before: function(paginationData, fullData) {
9+
// filter out entries without an id
10+
return paginationData.filter(item => item.id);
11+
}
12+
},
13+
permalink: "entities/place/{{ place.id | localName | slugify }}/"
14+
}
15+
---
16+
17+
{# "with context" means the imported templates will have access to all data #}
18+
{# see https://mozilla.github.io/nunjucks/templating.html#import #}
19+
{% import "src/_layouts/jsonld.njk" as jsonld with context %}
20+
21+
{% import "src/_layouts/placeHeader.njk" as header with context %}
22+
23+
{% set headerData = places | findById(place.id) %}
24+
{{ header.header(headerData) }}
25+
26+
27+
{# first parameter is the object to print, second parameter is the main entity printed #}
28+
{{ jsonld.render('', headerData) }}

0 commit comments

Comments
 (0)