From b78008532f09dce26018ea7ea544f0e40d36756d Mon Sep 17 00:00:00 2001
From: Md Jawad Noor Asif <jawad.asif.bd@gmail.com>
Date: Mon, 09 Jan 2023 22:12:52 +0000
Subject: [PATCH] feat: Added Bangla translations (#266)

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

diff --git a/layouts/partials/textprocessing.html b/layouts/partials/textprocessing.html
index 7f29028..dbcc053 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 -->
@@ -113,7 +130,7 @@
 {{end}}
 
 {{/* Make ==text== into <mark>text</mark> */}}
-{{$mark := findRE "(?Us)==([^\\$]+)==" $content}}
+{{$mark := findRE "==([^=\n]+)==" $content}}
 {{range $mark}}
   {{$fixed := printf "<mark>%s</mark>" (replace . "==" "")}}
   {{$content = replace $content . $fixed}}

--
Gitblit v1.10.0