Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7412b01

Browse files
authored
refactor: fallback to raw value when slug is empty (#1513)
1 parent7a2080e commit7412b01

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

‎gridsome/lib/plugins/TemplatesPlugin.js‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,12 @@ const makePath = (object, { routeKeys, createPath }, dateField = 'date', slugify
5151
){
5252
returnString(value.id)
5353
}elseif(!isPlainObject(value)){
54-
returnsuffix==='raw'
55-
?String(value)
56-
:slugify(String(value))
54+
constslugifyValue=slugify(String(value))
55+
if(suffix==='raw'||slugifyValue===''){
56+
returnString(value)
57+
}else{
58+
returnslugifyValue
59+
}
5760
}else{
5861
return''
5962
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp