-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Thorsten Marx
committed
Oct 25, 2023
1 parent
0c3dd81
commit 112c916
Showing
8 changed files
with
67 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
title: Navigation | ||
template: content.part.html | ||
--- | ||
|
||
Navigation is realy simple. | ||
|
||
```html | ||
<ul th:with="nodes=${navigation.list('/')}"> | ||
<li th:each="node : ${nodes}" th:if="${node.path} != '/'"> | ||
<a th:attr="aria-current=${node.current ? 'page' : ''}" | ||
th:classappend="${node.current}? 'active'" | ||
th:href="${node.path}" | ||
th:text="${node.name}"></a> | ||
</li> | ||
</ul> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- | ||
title: List of pages | ||
template: content.part.html | ||
--- | ||
|
||
Whenever you want to print out a list of pages, the nodeListFunction is a tiny little helper. | ||
Keep in mind, that the nodelist function does not return the hole rendered HTML content but just an excerpt of 200 characters. | ||
|
||
```html | ||
<!-- example for a blog overview page --> | ||
<div | ||
th:with='page = ${nodeList.from("/blog/*").sort("published").reverse(true).page(1).size(5).list()}'> | ||
<th:block th:each="entry : ${page.items}"> | ||
<h2 th:text="${entry.name}"></h2> | ||
<p th:text="${entry.content}"></p> | ||
<u th:text="${#dates.format(entry.meta['published'], 'dd-MM-yyyy HH:mm')}"></u> | ||
<a th:href="${entry.path}">goto</a> | ||
</th:block> | ||
</div> | ||
``` | ||
|
||
#### UseCase Blog | ||
Assume, your project has the following content structure for the blog, with the defaults _page = 1_ and _pageSize = 5_ | ||
``` | ||
blog/ | ||
---2023-09/ | ||
------entry1.md | ||
------entry2.md | ||
---2023-10/ | ||
------entry1.md | ||
``` | ||
This nodeList call will return all content nodes in all subfolders of the folder blog/ | ||
```javascript | ||
${nodeList.from("/blog/*").list()} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters