]> juplo.de Git - website/commitdiff
Shortcode zum einfügen von Marginal-Content aus einer Content-Seite heraus
authorKai Moritz <kai@juplo.de>
Thu, 18 Dec 2025 17:44:17 +0000 (18:44 +0100)
committerKai Moritz <kai@juplo.de>
Thu, 18 Dec 2025 23:34:10 +0000 (00:34 +0100)
content/about/_index.html
layouts/_shortcodes/marginalcontent-html.html [new file with mode: 0644]
layouts/_shortcodes/marginalcontent-md.html [new file with mode: 0644]
layouts/baseof.html

index 8ca409281529327670b7834525edf7ce5821d361..e298c4c8f9a52f13d37b7ba63323607e823a54be 100644 (file)
@@ -50,7 +50,7 @@ weight: 30
         <a href="references.html" th:href="@{/references.html}">what I have already done for others</a>.
       </p>
     </article>
-<aside class="marginalcontent">
+{{< marginalcontent-html >}}
       <h2>Funded by the Europian Union</h2>
       <p>
         As partner of the company
@@ -65,4 +65,4 @@ weight: 30
           <img alt="EFRE.NRW 2014-2020: Invesitionen in Wachstum und Beschäftigung" src="img/Ziel2NRW_4c_1809_eps.svg" th:src="@{/img/Ziel2NRW_4c_1809_eps.svg}" width="100%">
         </a>
       </p>
-    </aside>
+{{< /marginalcontent-html >}}
diff --git a/layouts/_shortcodes/marginalcontent-html.html b/layouts/_shortcodes/marginalcontent-html.html
new file mode 100644 (file)
index 0000000..c15cddb
--- /dev/null
@@ -0,0 +1 @@
+{{ .Page.Scratch.Add "marginalcontent" .Inner }}
diff --git a/layouts/_shortcodes/marginalcontent-md.html b/layouts/_shortcodes/marginalcontent-md.html
new file mode 100644 (file)
index 0000000..22e2f08
--- /dev/null
@@ -0,0 +1 @@
+{{ .Page.Scratch.Add "marginalcontent" ( .Inner | markdownify ) }}
index 0bb66c6e365c9a56cedd879a4428fedf67c08dcc..9ba6455cf77215c02c25b1cf6b2a2991e2c1662b 100644 (file)
         </article>
         <div class="marginal">
           {{- partial "menu.html" (dict "menuID" "main" "page" .) }}
-          {{- partial "marginalcontent.html" . }}
+          {{- block "marginalcontent" . }}{{ end }}
         </div>
     </main>
     {{- partial "footer.html" . }}
   </div>
 </body>
 </html>
+
+{{ define "marginalcontent" }}
+  {{ with .Scratch.Get "marginalcontent" }}
+    <aside class="m">{{ . }}</aside>
+  {{ end }}
+{{ end }}