Skip to content

Commit 0f0e027

Browse files
committed
Remove trailing and leading slashes off the $url for Breadcrumb gen;
so that no empty values remain in []interface fixes: #331
1 parent fb4988c commit 0f0e027

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

layouts/partials/breadcrumbs.html

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{{- if (.Param "ShowBreadCrumbs")}}
22
<div class="breadcrumbs">
33
{{- $url := replace .Parent.Permalink ( printf "%s" .Site.BaseURL) "" }}
4+
{{- $url = (trim $url "/" ) }}
45
{{- $lang_url := strings.TrimPrefix ( printf "%s/" .Lang) $url }}
56

67
<a href="{{ "" | absLangURL }}">{{ i18n "home" | default "Home"}}</a>

layouts/partials/templates/schema_json.html

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
{{- else if (or .IsPage .IsSection) }}
2020
{{/* BreadcrumbList */}}
2121
{{- $url := replace .Parent.Permalink ( printf "%s" .Site.BaseURL) "" }}
22+
{{- $url = (trim $url "/" ) }}
2223
{{- $lang_url := strings.TrimPrefix ( printf "%s/" .Lang) $url }}
2324
{{- $bc_list := (split $lang_url "/")}}
2425

0 commit comments

Comments
 (0)