mirror of
				https://github.com/Wonderfall/hugo-WonderMod.git
				synced 2025-10-30 19:35:26 +01:00 
			
		
		
		
	Enforce language url subsitution on path boundary for breadcrumbs (#254)
* Without this, the section name gets mangled when the language was a sub-string of the section. For example, under 'en', a section named "fragment" changes to "fragmt".
This commit is contained in:
		| @@ -1,7 +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) "" }} | ||||||
|     {{- $lang_url := replace $url ( printf "%s" .Lang) "" }} |     {{- $lang_url := strings.TrimPrefix ( printf "%s/" .Lang) $url }} | ||||||
|  |  | ||||||
|     <a href="{{ "" | absLangURL }}">{{ i18n "home" | default "Home"}}</a> |     <a href="{{ "" | absLangURL }}">{{ i18n "home" | default "Home"}}</a> | ||||||
|     {{- $scratch := newScratch }} |     {{- $scratch := newScratch }} | ||||||
|   | |||||||
| @@ -19,7 +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) "" }} | ||||||
| {{- $lang_url := replace $url ( printf "%s" .Lang) "" }} | {{- $lang_url := strings.TrimPrefix ( printf "%s/" .Lang) $url }} | ||||||
| {{- $bc_list := (split $lang_url "/")}} | {{- $bc_list := (split $lang_url "/")}} | ||||||
|  |  | ||||||
| {{- $scratch := newScratch }} | {{- $scratch := newScratch }} | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Jason Lavoie
					Jason Lavoie