DRY-Prinzip bei Bereichs-Definition angewendet
authorKai Moritz <kai@juplo.de>
Thu, 7 Jul 2016 09:08:35 +0000 (11:08 +0200)
committerKai Moritz <kai@juplo.de>
Wed, 28 Jun 2017 09:23:38 +0000 (11:23 +0200)
dist/templates/layout.html
dist/templates/variables.json

index 6dbd446..a6d5ccf 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 : ${sections}" th:class="'m ' + ${entry.value.key}">
-                <a href="../blog.html" th:href="@{${entry.key}}" class="m" th:class="${entry.key == section.uri} ? 'm selected' : 'm'" th:text="${entry.value.name}">Blog</a>
+              <li class="m blog" th:each="entry : ${sections}" th:class="'m ' + ${entry.key}">
+                <a href="../blog.html" th:href="@{${entry.value}}" class="m" th:class="${entry.value == section.uri} ? 'm selected' : 'm'" th:text="${pages.get(entry.value).name}">Blog</a>
               </li>
               <!--/*-->
               <li class="m projects"><a href="../projects" class="m selected">Projects</a></li>
index 2f7172c..d09f083 100644 (file)
@@ -1,8 +1,8 @@
 {
   "sections": {
-    "/blog.html": { "name": "Blog", "key": "blog" },
-    "/projects.html": { "name": "Projects", "key": "projects" },
-    "/about.html": { "name": "About", "key": "about" }
+    "blog": "/blog.html",
+    "projects": "/projects.html",
+    "about": "/about.html"
   },
   "pages": {
     "/index.html": { "name": "Home" },