summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAditya Telange <21258296+adityatelange@users.noreply.github.com>2021-03-28 19:23:53 +0530
committerAditya Telange <21258296+adityatelange@users.noreply.github.com>2021-03-28 19:25:09 +0530
commit0f0e027def4bce325f810be4c9f4e3c3a9218b68 (patch)
treed0b9c92727698a0048f264c1e5340f5bcf00d967
parentfb4988cfb6d0d6e4e489f17d89f0fa618def3396 (diff)
Remove trailing and leading slashes off the $url for Breadcrumb gen;
so that no empty values remain in []interface fixes: #331
-rw-r--r--layouts/partials/breadcrumbs.html1
-rw-r--r--layouts/partials/templates/schema_json.html1
2 files changed, 2 insertions, 0 deletions
diff --git a/layouts/partials/breadcrumbs.html b/layouts/partials/breadcrumbs.html
index 0ffbc09..bf1f4b2 100644
--- a/layouts/partials/breadcrumbs.html
+++ b/layouts/partials/breadcrumbs.html
@@ -1,6 +1,7 @@
{{- if (.Param "ShowBreadCrumbs")}}
<div class="breadcrumbs">
{{- $url := replace .Parent.Permalink ( printf "%s" .Site.BaseURL) "" }}
+ {{- $url = (trim $url "/" ) }}
{{- $lang_url := strings.TrimPrefix ( printf "%s/" .Lang) $url }}
<a href="{{ "" | absLangURL }}">{{ i18n "home" | default "Home"}}</a>
diff --git a/layouts/partials/templates/schema_json.html b/layouts/partials/templates/schema_json.html
index 6e0a289..df11065 100644
--- a/layouts/partials/templates/schema_json.html
+++ b/layouts/partials/templates/schema_json.html
@@ -19,6 +19,7 @@
{{- else if (or .IsPage .IsSection) }}
{{/* BreadcrumbList */}}
{{- $url := replace .Parent.Permalink ( printf "%s" .Site.BaseURL) "" }}
+{{- $url = (trim $url "/" ) }}
{{- $lang_url := strings.TrimPrefix ( printf "%s/" .Lang) $url }}
{{- $bc_list := (split $lang_url "/")}}