mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-20 03:14:06 -06:00
Use frontmatter password if encrypting due to folder
This commit is contained in:
parent
19abdca764
commit
33e4e8ea52
@ -75,8 +75,7 @@ const config: QuartzConfig = {
|
|||||||
algorithm: "aes-256-cbc",
|
algorithm: "aes-256-cbc",
|
||||||
keyLength: 32,
|
keyLength: 32,
|
||||||
iterations: 100000,
|
iterations: 100000,
|
||||||
encryptedFolders: {
|
encryptedFolders: {},
|
||||||
},
|
|
||||||
ttl: 3600 * 24 * 7, // A week
|
ttl: 3600 * 24 * 7, // A week
|
||||||
}),
|
}),
|
||||||
Plugin.Description(),
|
Plugin.Description(),
|
||||||
|
|||||||
@ -123,7 +123,11 @@ export const EncryptPlugin: QuartzTransformerPlugin<Partial<Options>> = (userOpt
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (deepestFolder) {
|
if (deepestFolder) {
|
||||||
return String(opts.encryptedFolders[deepestFolder])
|
if (frontmatter?.password) { // if frontmatter has a password, use it
|
||||||
|
return frontmatter.password as string;
|
||||||
|
}
|
||||||
|
|
||||||
|
return opts.encryptedFolders[deepestFolder] as string;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user