check if there's anything in a list..

This commit is contained in:
Marcell Mars 2021-05-04 01:17:55 +02:00
parent 758bb2e474
commit 5e9cdccbb8
1 changed files with 3 additions and 1 deletions

View File

@ -11,7 +11,9 @@ function captureFrontMatterAndMarkdown() {
} else if (k.endsWith('[]')) {
formData.set(k, formData.getAll(k))
var s = JSON.stringify(formData.getAll(k)[0].split(","))
frontmatter += `${k.slice(0, -2)}: ${s}\n`
if (s != "") {
frontmatter += `${k.slice(0, -2)}: ${s}\n`
}
} else if (k == "relpath") {
filepath = `${location.pathname.split('/public')[0]}/content/${formData.get(k)}`
gitpath = `${location.pathname.split('/public')[0]}`