Variable "menu" in "sections" umbenannt und Section-Handling vereinfacht
authorKai Moritz <kai@juplo.de>
Tue, 5 Jul 2016 08:58:21 +0000 (10:58 +0200)
committerKai Moritz <kai@juplo.de>
Wed, 28 Jun 2017 09:23:29 +0000 (11:23 +0200)
dist/thymeleaf/templates/layout.html
dist/thymeleaf/templates/variables.json

index 0fb2b01..2ff0255 100644 (file)
             <h1 class="nav">Navigation</h1>
             <h2 class="nav menu">Section-Menu</h2>
             <ul id="menu" class="cf">
-              <li class="m blog" th:each="entry : ${menu}" th:class="'m ' + ${entry.key}">
-                <a href="../blog.html" th:href="@{/__${entry.key}__.html}" class="m" th:class="${('/' + entry.key + '.html') == section.uri} ? 'm selected' : 'm'" th:text="${entry.value}">Blog</a>
+              <li class="m blog" th:each="entry : ${sections}" th:class="'m ' + ${entry.key}">
+                <a href="../blog.html" th:href="@{${entry.value.uri}}" class="m" th:class="${entry.value.uri == section.uri} ? 'm selected' : 'm'" th:text="${entry.value.name}">Blog</a>
               </li>
               <!--/*-->
               <li class="m projects"><a href="../projects" class="m selected">Projects</a></li>
index 2825cbe..8b192f5 100644 (file)
       { "uri": "/projects/typo.html", "name": "Typography" }
     ]
   },
-  "menu": {
-    "blog": "Blog",
-    "projects": "Projects",
-    "about": "About"
+  "sections": {
+    "blog": { "name": "Blog", "uri": "/blog.html" },
+    "projects": { "name": "Projects", "uri": "/projects.html" },
+    "about": { "name": "About", "uri": "/about.html" }
   },
   "submenu": {
     "#": { "name": "hibernate4-maven-plugin" },