From 7a8811a184c8bd6206ee041d6486b7e456d5a84a Mon Sep 17 00:00:00 2001
From: Quadrubo <71718414+Quadrubo@users.noreply.github.com>
Date: Wed, 18 Jan 2023 16:25:01 +0000
Subject: [PATCH] added the liveReloadPort as an option for docker (#272)

---
 layouts/partials/textprocessing.html |   20 +++++++++++++++++++-
 1 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/layouts/partials/textprocessing.html b/layouts/partials/textprocessing.html
index 7b82f32..09e2318 100644
--- a/layouts/partials/textprocessing.html
+++ b/layouts/partials/textprocessing.html
@@ -42,7 +42,24 @@
     <!-- remove subfolder from title -->
     {{$display := index (last 1 (split $display "/")) 0}}
 
-    {{$curpage := $page.GetPage $title}}
+    <!-- attempt to get title -->
+    {{$searchtitle := $title }}
+    {{$curpage := $page.GetPage $searchtitle }}
+    <!-- attempt to search md file instead  -->
+    {{ if (eq $curpage.String "nopPage") }}
+      {{$searchtitle = (add $title ".md") }}
+      {{$curpage = $page.GetPage $searchtitle }}
+    {{ end }}
+    <!-- attempt to reverse typographer behaviour  -->
+    {{ if (eq $curpage.String "nopPage") }}
+      {{$searchtitle = (replace $searchtitle "&amp;" "&") }}
+      {{$searchtitle = (replace $searchtitle "&quot;" "\"") }}
+      {{$searchtitle = (replace $searchtitle "&rdquo;" "\"") }}
+      {{$searchtitle = (replace $searchtitle "&ldquo;" "\"") }}
+      {{$searchtitle = (replace $searchtitle "&rsquo;" "'") }}
+      {{$searchtitle = (replace $searchtitle "&lsquo;" "'") }}
+      {{$curpage = $page.GetPage $searchtitle }}
+    {{ end }}
     {{$relpath := relURL $path}}
 
     <!-- If path to Hugo page -->
@@ -110,6 +127,7 @@
   {{end}}
   {{ $content = $content | replaceRE `\[![a-zA-Z]+\][-\+]?` "" }}
   {{ $content = $content | replaceRE "blockquote class=callout" "blockquote" }}
+  {{ $content = $content | replaceRE `(?s)(<blockquote class="\S+-callout">.*?)<br>(.*?<\/blockquote)` `${1}</p><p>${2}` }}
 {{end}}
 
 {{/* Make ==text== into <mark>text</mark> */}}

--
Gitblit v1.10.0