Skip to content

Commit 4a32e9b

Browse files
authored
Merge pull request #1634 from gethinode/develop
feat: add exact argument to link partial/shortcode
2 parents 78614be + c607ca1 commit 4a32e9b

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

data/structures/link.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@ arguments:
2626
group: partial
2727
optional: true
2828
release: v1.0.0
29+
exact:
30+
type: bool
31+
comment: >-
32+
Renders the provided link description as-is, without adjusting the case.
33+
Overrides the case setting.
34+
optional: true
35+
release: v1.20.0
2936
# deprecated arguments
3037
destination:
3138
type: string

layouts/_partials/assets/link.html

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,12 @@
120120
{{ end }}
121121
{{ end }}
122122

123-
{{- if not $args.case }}
124-
{{ $text = lower $text }}
125-
{{ else if site.Params.main.titleCase }}
126-
{{ $text = title $text }}
123+
{{- if not $args.exact }}
124+
{{- if not $args.case }}
125+
{{ $text = lower $text }}
126+
{{ else if site.Params.main.titleCase }}
127+
{{ $text = title $text }}
128+
{{ end -}}
127129
{{ end -}}
128130

129131
{{ if and $pretty (not (hasSuffix $destination "/" )) (not (strings.Contains $destination "#")) }}

0 commit comments

Comments
 (0)