From b5944e1a3ac3bce44e4737bb119ba2f9f2510c27 Mon Sep 17 00:00:00 2001 From: Hongbo Wu Date: Fri, 10 Nov 2023 12:24:15 +0800 Subject: [PATCH] feat: use id as filename (#152) --- src/settings/index.ts | 2 +- src/settings/template.ts | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/settings/index.ts b/src/settings/index.ts index 0396c53..f80428e 100644 --- a/src/settings/index.ts +++ b/src/settings/index.ts @@ -108,7 +108,7 @@ export const settingsSchema = async (): Promise => [ title: t('Article Template'), default: '', description: t( - 'If the above item is off, want to sync to a separate page for each article, use the variable `{{{title}}}`, `{{{date}}}` or `{{{currentDate}}}` as the page name. For example, `{{{title}}}` will create a page for each article with the title of the article.' + 'If the above item is off, want to sync to a separate page for each article, use the variable `{{id}}`, `{{{title}}}`, `{{{date}}}` or `{{{currentDate}}}` as the page name. For example, `{{{title}}}` will create a page for each article with the title of the article.' ), }, { diff --git a/src/settings/template.ts b/src/settings/template.ts index f7c4a8e..67ee884 100644 --- a/src/settings/template.ts +++ b/src/settings/template.ts @@ -17,6 +17,7 @@ type FunctionMap = { export type ArticleView = | { + id: string title: string author?: string omnivoreUrl: string @@ -146,6 +147,7 @@ const createArticleView = ( ? formatDate(new Date(article.archivedAt), preferredDateFormat) : undefined return { + id: article.id, title: article.title, omnivoreUrl: `https://omnivore.app/me/${article.slug}`, siteName,