From 61b46bc5acb2f5ff1ee360e76b722167624c8ab5 Mon Sep 17 00:00:00 2001 From: Elio Struyf Date: Wed, 19 Jan 2022 14:00:05 +0100 Subject: [PATCH] Update comments --- src/commands/Article.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/commands/Article.ts b/src/commands/Article.ts index 681753fb..cfd5e11f 100644 --- a/src/commands/Article.ts +++ b/src/commands/Article.ts @@ -190,11 +190,13 @@ export class Article { article.data["slug"] = slugFieldValue; if (contentType) { + // Update the fields containing the slug placeholder let fieldsToUpdate: Field[] = contentType.fields.filter(f => f.default === "{{slug}}"); for (const field of fieldsToUpdate) { article.data[field.name] = slug; } + // Update the fields containing a custom placeholder that depends on slug const placeholders = Settings.get<{id: string, value: string}[]>(SETTINGS_CONTENT_PLACEHOLDERS); const customPlaceholders = placeholders?.filter(p => p.value.includes("{{slug}}")); for (const customPlaceholder of (customPlaceholders || [])) {