This commit is contained in:
Jerry
2024-10-13 19:27:38 +08:00
parent 2ca779a6ad
commit 90b4511193
3 changed files with 26 additions and 35 deletions

View File

@@ -82,7 +82,7 @@ hexo.extend.helper.register('getBgPath', path => {
const absoluteUrlPattern = /^(?:[a-z][a-z\d+.-]*:)?\/\//i
const relativeUrlPattern = /^(\.\/|\.\.\/|\/|[^/]+\/).*$/
const colorPattern = /^(#|rgb|rgba|hsl|hsla|linear-gradient|radial-gradient)/i
const colorPattern = /^(#|rgb|rgba|hsl|hsla)/i
if (colorPattern.test(path)) {
return `background-color: ${path};`