diff --git a/src/api.ts b/src/api.ts index ca9863f..197cb74 100644 --- a/src/api.ts +++ b/src/api.ts @@ -57,6 +57,7 @@ export interface Article { readingProgressPercent: number isArchived: boolean wordsCount?: number + dateArchived?: string } export interface Label { @@ -120,6 +121,10 @@ export const getOmnivoreArticles = async ( content publishedAt readAt + isArchived + readingProgressPercent + wordsCount + dateArchived highlights { id quote @@ -135,9 +140,6 @@ export const getOmnivoreArticles = async ( labels { name } - isArchived - readingProgressPercent - wordsCount } } pageInfo { diff --git a/src/index.ts b/src/index.ts index d06aa7a..48e7227 100644 --- a/src/index.ts +++ b/src/index.ts @@ -431,7 +431,7 @@ const fetchOmnivore = async (inBackground = false) => { parseDateTime(syncAt).toISO(), endpoint ) - for (const deletedArticle of deletedArticles) { + for await (const deletedArticle of deletedArticles) { if (!isSinglePage) { pageName = renderPageName( deletedArticle, diff --git a/src/settings/template.ts b/src/settings/template.ts index a77bd1d..1b697fc 100644 --- a/src/settings/template.ts +++ b/src/settings/template.ts @@ -34,6 +34,7 @@ export type ArticleView = state: string wordsCount?: number readLength?: number + dateArchived?: string } | FunctionMap @@ -138,6 +139,9 @@ const createArticleView = ( const readLength = wordsCount ? Math.round(Math.max(1, wordsCount / 235)) : undefined + const dateArchived = article.dateArchived + ? formatDate(new Date(article.dateArchived), preferredDateFormat) + : undefined return { title: article.title, omnivoreUrl: `https://omnivore.app/me/${article.slug}`, @@ -156,6 +160,7 @@ const createArticleView = ( state: getArticleState(article), wordsCount, readLength, + dateArchived, ...functionMap, } } @@ -196,9 +201,9 @@ export const renderPageName = ( preferredDateFormat: string ) => { const date = formatDate(new Date(article.savedAt), preferredDateFormat) - // replace slashes and colon with dash in the title to prevent creating subpages + // replace slash with dash in the title to prevent creating subpages // since there is no way to escape slashes in logseq - const title = article.title.replace(/[/:]/g, '-') + const title = article.title.replace(/\//g, '-') const renderedPageName = Mustache.render(pageName, { title,