mirror of
https://github.com/Wonderfall/hugo-WonderMod.git
synced 2024-11-25 12:01:37 +01:00
Remove trailing and leading slashes off the $url for Breadcrumb gen;
so that no empty values remain in []interface fixes: #331
This commit is contained in:
parent
fb4988cfb6
commit
0f0e027def
@ -1,6 +1,7 @@
|
|||||||
{{- if (.Param "ShowBreadCrumbs")}}
|
{{- if (.Param "ShowBreadCrumbs")}}
|
||||||
<div class="breadcrumbs">
|
<div class="breadcrumbs">
|
||||||
{{- $url := replace .Parent.Permalink ( printf "%s" .Site.BaseURL) "" }}
|
{{- $url := replace .Parent.Permalink ( printf "%s" .Site.BaseURL) "" }}
|
||||||
|
{{- $url = (trim $url "/" ) }}
|
||||||
{{- $lang_url := strings.TrimPrefix ( printf "%s/" .Lang) $url }}
|
{{- $lang_url := strings.TrimPrefix ( printf "%s/" .Lang) $url }}
|
||||||
|
|
||||||
<a href="{{ "" | absLangURL }}">{{ i18n "home" | default "Home"}}</a>
|
<a href="{{ "" | absLangURL }}">{{ i18n "home" | default "Home"}}</a>
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
{{- else if (or .IsPage .IsSection) }}
|
{{- else if (or .IsPage .IsSection) }}
|
||||||
{{/* BreadcrumbList */}}
|
{{/* BreadcrumbList */}}
|
||||||
{{- $url := replace .Parent.Permalink ( printf "%s" .Site.BaseURL) "" }}
|
{{- $url := replace .Parent.Permalink ( printf "%s" .Site.BaseURL) "" }}
|
||||||
|
{{- $url = (trim $url "/" ) }}
|
||||||
{{- $lang_url := strings.TrimPrefix ( printf "%s/" .Lang) $url }}
|
{{- $lang_url := strings.TrimPrefix ( printf "%s/" .Lang) $url }}
|
||||||
{{- $bc_list := (split $lang_url "/")}}
|
{{- $bc_list := (split $lang_url "/")}}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user