Skip to content

Commit

Permalink
Fix typesense on prod (#3822)
Browse files Browse the repository at this point in the history
  • Loading branch information
npentrel authored Jan 9, 2025
1 parent 5070ea3 commit ec8d308
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions layouts/_default/list.typesense.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,25 @@
{{- if and (eq (path.Ext (index .Params.videos 0)) ".webm") (eq (path.Ext (index .Params.videos 1)) ".mp4") -}}

{{- if eq ((index .Params.videos 0) | printf "%.1s") "/" -}}
{{- $.Scratch.Set "webm" (printf "..%s" (index .Params.videos 0)) -}}
{{- $.Scratch.Set "webm" (printf "%s" (index .Params.videos 0)) -}}
{{- else -}}
{{- $.Scratch.Set "webm" (printf "%s" (index .Params.videos 0)) -}}
{{- end -}}
{{- if eq ((index .Params.videos 1) | printf "%.1s") "/" -}}
{{- $.Scratch.Set "mp4" (printf "..%s" (index .Params.videos 1)) -}}
{{- $.Scratch.Set "mp4" (printf "%s" (index .Params.videos 1)) -}}
{{- else -}}
{{- $.Scratch.Set "mp4" (printf "%s" (index .Params.videos 1)) -}}
{{- end -}}

{{- else if and (eq (path.Ext (index .Params.videos 1)) ".webm") (eq (path.Ext (index .Params.videos 0)) ".mp4") -}}

{{- if eq ((index .Params.videos 1) | printf "%.1s") "/" -}}
{{- $.Scratch.Set "webm" (printf "..%s" (index .Params.videos 1)) -}}
{{- $.Scratch.Set "webm" (printf "%s" (index .Params.videos 1)) -}}
{{- else -}}
{{- $.Scratch.Set "webm" (printf "%s" (index .Params.videos 1)) -}}
{{- end -}}
{{- if eq ((index .Params.videos 0) | printf "%.1s") "/" -}}
{{- $.Scratch.Set "mp4" (printf "..%s" (index .Params.videos 0)) -}}
{{- $.Scratch.Set "mp4" (printf "%s" (index .Params.videos 0)) -}}
{{- else -}}
{{- $.Scratch.Set "mp4" (printf "%s" (index .Params.videos 0)) -}}
{{- end -}}
Expand All @@ -57,7 +57,7 @@
{{- $image_extensions := slice ".png" ".jpg" ".jpeg" ".svg" -}}
{{- if in $image_extensions $image_ext -}}
{{- if eq ((index .Params.images 0) | printf "%.1s") "/" -}}
{{- $.Scratch.Set "image" (printf "..%s" (index .Params.images 0)) -}}
{{- $.Scratch.Set "image" (printf "%s" (index .Params.images 0)) -}}
{{- else -}}
{{- $.Scratch.Set "image" (printf "%s" (index .Params.images 0)) -}}
{{- end -}}
Expand All @@ -84,7 +84,7 @@
{{- $.Scratch.Set "relpermalink" (printf "%s" .Params.canonical) -}}
{{- else -}}
{{- $.Scratch.Set "permalink" .Permalink -}}
{{- $.Scratch.Set "relpermalink" (printf "..%s" .RelPermalink) -}}
{{- $.Scratch.Set "relpermalink" (printf "%s" .RelPermalink) -}}
{{- end -}}

{{- $.Scratch.Add "index"
Expand Down Expand Up @@ -130,7 +130,7 @@
{{- $.Scratch.Set "relpermalink" (printf "%s" .Params.canonical) -}}
{{- else -}}
{{- $.Scratch.Set "permalink" .Permalink -}}
{{- $.Scratch.Set "relpermalink" (printf "../..%s" .RelPermalink) -}}
{{- $.Scratch.Set "relpermalink" (printf "%s" .RelPermalink) -}}
{{- end -}}
{{- $.Scratch.Set "id" (printf "builtin:rdk:component:%s:%s" (strings.Replace (strings.ToLower .Parent.LinkTitle) " " "_" ) (strings.ToLower .LinkTitle) ) -}}
{{- $.Scratch.Set "api" (printf "rdk:component:%s" (strings.Replace (strings.ToLower .Parent.LinkTitle) " " "_" )) -}}
Expand Down Expand Up @@ -169,7 +169,7 @@
{{- $.Scratch.Set "relpermalink" (printf "%s" .Params.canonical) -}}
{{- else -}}
{{- $.Scratch.Set "permalink" .Permalink -}}
{{- $.Scratch.Set "relpermalink" (printf "../../..%s" .RelPermalink) -}}
{{- $.Scratch.Set "relpermalink" (printf "%s" .RelPermalink) -}}
{{- end -}}

{{- $.Scratch.Set "id" (printf "builtin:rdk:service:%s:%s" (strings.Replace (strings.ToLower .Parent.LinkTitle) " " "_" ) (strings.ToLower .LinkTitle) ) -}}
Expand Down

0 comments on commit ec8d308

Please sign in to comment.