mirror of
https://github.com/tiennm99/HugoBlox-kit.git
synced 2026-10-14 06:17:20 +00:00
Fix error when menu URL shorter than 4 characters is set
Fix the error when calling slicestr to slice out-of-range bounds See #439
This commit is contained in:
1 parent
0514bbd48d
commit
a42037eadd
1 file changed
+7
-5
@@ -51,11 +51,13 @@
|
||||
</li>
|
||||
|
||||
{{ else }}
|
||||
|
||||
{{ if eq "http" (slicestr .URL 0 4) }}
|
||||
{{ $.Scratch.Set "target" " target=\"_blank\" rel=\"noopener\"" }}
|
||||
{{ else }}
|
||||
{{ $.Scratch.Set "target" "" }}
|
||||
|
||||
{{/* Set target for link. */}}
|
||||
{{ $.Scratch.Set "target" "" }}
|
||||
{{ if gt (len .URL) 4 }}
|
||||
{{ if eq "http" (slicestr .URL 0 4) }}
|
||||
{{ $.Scratch.Set "target" " target=\"_blank\" rel=\"noopener\"" }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
<li class="nav-item">
|
||||
|
||||
Reference in new issue
Block a user