Skip to content

Commit

Permalink
enforce language url subsitution on path boundary
Browse files Browse the repository at this point in the history
  Without this, the section name gets mangled when the language was a
  substring of the section.  For example, under 'en', a section named
  "fragment" changes to "fragmt".
  • Loading branch information
oasys committed Feb 21, 2021
1 parent e53bfe5 commit 8a1270e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion layouts/partials/breadcrumbs.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{- if (.Param "ShowBreadCrumbs")}}
<div class="breadcrumbs">
{{- $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>
{{- $scratch := newScratch }}
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/templates/schema_json.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
{{- else if (or .IsPage .IsSection) }}
{{/* BreadcrumbList */}}
{{- $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 "/")}}

{{- $scratch := newScratch }}
Expand Down

0 comments on commit 8a1270e

Please sign in to comment.