Kanonische Links über _canonical realisiert frontend
authorKai Moritz <kai@juplo.de>
Mon, 7 Mar 2022 22:14:32 +0000 (23:14 +0100)
committerKai Moritz <kai@juplo.de>
Mon, 7 Mar 2022 22:14:32 +0000 (23:14 +0100)
TODO.txt
dist/potemkin.html [new file with mode: 0644]
dist/potemkin.json
dist/projects.html
dist/sitemap.json
dist/templates/layout.html

index 278b0f1..f81c8c7 100644 (file)
--- a/TODO.txt
+++ b/TODO.txt
@@ -1,6 +1,17 @@
+DONE:
+
+* maven-thymeleaf-skin generiert _immer_ Pfade der Art PFAD/VERSION
+* Die Projekte kommen unter /projects/NAME/VERSION zu liegen
+* Die URI der Einstiegsseite muss in der sitemap.json eingetragen sein
+** /projects/NAME/VERSION/index.html unter `_titles`
+** /projects/NAME/VERSION/index.html als Kind von `/projects.html`
+** Passende Breadcrumbs für die Seite nicht vergessen!
+** *Achtung:* Menü wird bei Fehlern nicht korrekt (vollständig!) generiert
+* Das Mapping von /NAME/ auf /projects/NAME/VERSION/index.html in der
+  Konfiguration des Webservers muss angepasst werden - Vorteil:
+  Neue Doku kann deployed und getestet werden, bevor sie sichtbar
+  gemacht werden muss.
+
+TODO:
+
 * Keine hartkodierten Links mit juplo.de im Content!!
-* Links mit Version in thymeleaf-skin generieren
-* ABER: Für oberste Ebene nicht?!?
-* Nicht bis ins letzte Detail automatisieren: Letzte Anpassungen von Hand
-  (Z.B., zusätzliche/geänderte Links nachdem neue Version herausgekommen ist?)
-* JSON für Menü-Generierung funktioniert nicht!
diff --git a/dist/potemkin.html b/dist/potemkin.html
new file mode 100644 (file)
index 0000000..5a113d7
--- /dev/null
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<html
+    xmlns="http://www.w3.org/1999/xhtml"
+    th:replace="~{/templates/layout.html :: layout(
+      uri='/projects.html',
+      title=~{:: title},
+      maincontent=~{:: .maincontent},
+      marginalcontent=~{:: .marginalcontent}, json='MERGE:/potemkin.json')}"
+    >
+  <head>
+    <title id="title">Projects - Potemkinsche Dörfer!</title>
+    <!--/*-->
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+    <link rel="stylesheet/less" type="text/css" href="less/base.less"/>
+    <link rel="stylesheet/less" type="text/css" href="less/screen.less" media="screen"/>
+    <link rel="stylesheet/less" type="text/css" href="less/print.less" media="print"/>
+    <script src="js/less-1.7.0.min.js"></script>
+    <!--*/-->
+  </head>
+  <body>
+   <main class="maincontent">
+     <h1>Projects - Potemkinsche Dörfer!</h1>
+     <ul>
+       <li><a href="potemkin/fix-swf/overview.html" th:href="@{/potemkin/fix-swf/overview.html}">Fix SWF</a></li>
+       <li><a href="potemkin/html-experimente.html" th:href="@{/potemkin/html-experimente.html}">HTML-Experimente</a></li>
+       <li><a href="potemkin/accelerator.html" th:href="@{/potemkin/accelerator.html}">accelerator</a></li>
+       <li><a href="potemkin/typo.html" th:href="@{/potemkin/typo.html}">Typography</a></li>
+     </ul>
+   </main>
+  </body>
+</html>
index c3765e9..f89bba3 100644 (file)
     ]
   },
   "_crumbs": {
-    "/projects.html": [
-      "/index.html",
-      "/projects.html"
-    ],
     "/potemkin/fix-swf/overview.html": [
       "/index.html",
       "/projects.html",
index 5a113d7..d80d751 100644 (file)
@@ -5,7 +5,7 @@
       uri='/projects.html',
       title=~{:: title},
       maincontent=~{:: .maincontent},
-      marginalcontent=~{:: .marginalcontent}, json='MERGE:/potemkin.json')}"
+      marginalcontent=~{:: .marginalcontent})}"
     >
   <head>
     <title id="title">Projects - Potemkinsche Dörfer!</title>
index 2e46815..e97ceff 100644 (file)
@@ -3,6 +3,9 @@
     "/index.html": "Home",
     "/blog/": "Blog",
     "/projects.html": "Projects",
+    "/projects/hibernate-maven-plugin/2.1.2-SNAPSHOT/index.html": "Hibernate Maven Plugin",
+    "/projects/http-resources/2.0.0/index.html": "HTTP resources",
+    "/projects/maven-thymeleaf-skin/1.1.0/index.html": "Maven Thymeleaf Skin",
     "/about.html": "About",
     "/expertise.html": "Expertise",
     "/references.html": "References",
     ],
     "/blog/": [],
     "/projects.html": [
-      "/hibernate-maven-plugin/index.html",
-      "/projects/hibernate-maven-plugin-2.1.2-SNAPSHOT/index.html",
-      "/http-resources/2.0.0/index.html",
-      "/maven-thymeleaf-skin/1.1-SNAPSHOT/index.html"
+      "/projects/hibernate-maven-plugin/2.1.2-SNAPSHOT/index.html",
+      "/projects/http-resources/2.0.0/index.html",
+      "/projects/maven-thymeleaf-skin/1.1.0/index.html"
     ],
     "/about.html": [
       "/expertise.html",
     "/index.html": [
       "/index.html"
     ],
+    "/projects.html": [
+      "/index.html",
+      "/projects.html"
+    ],
+    "/projects/hibernate-maven-plugin/2.1.2-SNAPSHOT/index.html": [
+      "/index.html",
+      "/projects.html",
+      "/projects/hibernate-maven-plugin/2.1.2-SNAPSHOT/index.html"
+    ],
+    "/projects/http-resources/2.0.0/index.html": [
+      "/index.html",
+      "/projects.html",
+      "/projects/http-resources/2.0.0/index.html"
+    ],
+    "/projects/maven-thymeleaf-skin/1.1.0/index.html": [
+      "/index.html",
+      "/projects.html",
+      "/projects/maven-thymeleaf-skin/1.1.0/index.html"
+    ],
     "/about.html": [
       "/index.html",
       "/about.html"
       "/index.html",
       "/templates/error.html"
     ]
-  }
+  },
+  "_canonical": {}
 }
index 16da131..7175241 100644 (file)
@@ -5,17 +5,17 @@
     th:fragment="layout(uri,maincontent)"
     thymeproxy:variables="SET:sitemap.json"
     >
-  <head>
+  <head thymeproxy:variables="${json}">
     <meta charset="utf-8">
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <meta name="viewport" content="width=device-width, initial-scale=1">
     <title th:replace="${title}">juplo - BASISTEMPLATE</title>
     <link rel="stylesheet" href="../css/juplo.css" th:href="@{/css/juplo.css}">
-    <link rel="caononical" href="layout.html" th:replace="${scripts_head}?:~{}">
+    <link rel="canonical" href="layout.html" th:href="${_canonical.get(uri)}?:${uri}">
+    <script th:replace="${scripts_head}?:~{}"></script>
   </head>
   <body
       th:fragment="body(uri, maincontent, marginalcontent)"
-      thymeproxy:variables="${json}"
       th:with="crumbs=${_crumbs.get(uri)}">
     <div id="page" class="">
       <main class="content section" th:include="${maincontent}" th:fragment="maincontent">