diff --git a/packages/cli/src/lib/markdown.ts b/packages/cli/src/lib/markdown.ts index 560f074..9d19ca9 100644 --- a/packages/cli/src/lib/markdown.ts +++ b/packages/cli/src/lib/markdown.ts @@ -109,6 +109,14 @@ export function parseFrontmatter( frontmatter.draft = draftValue === true || draftValue === "true"; } + // Discoverable mapping (defaults to true if not set or invalid) + const discoverableValue = raw.discoverable; + if (discoverableValue === false || discoverableValue === "false") { + frontmatter.discoverable = false; + } else { + frontmatter.discoverable = true; + } + // Always preserve atUri (internal field) frontmatter.atUri = raw.atUri; diff --git a/packages/cli/src/lib/types.ts b/packages/cli/src/lib/types.ts index 46e205e..035838e 100644 --- a/packages/cli/src/lib/types.ts +++ b/packages/cli/src/lib/types.ts @@ -97,6 +97,7 @@ export interface PostFrontmatter { ogImage?: string; atUri?: string; draft?: boolean; + discoverable?: boolean; } export interface BlogPost { diff --git a/packages/remanso/src/commands/sync.ts b/packages/remanso/src/commands/sync.ts index e4074bc..24e7105 100644 --- a/packages/remanso/src/commands/sync.ts +++ b/packages/remanso/src/commands/sync.ts @@ -60,13 +60,16 @@ async function matchesPDS( rkey, }); const noteValue = noteResponse.data.value as Record; + const localDiscoverable = localPost.frontmatter.discoverable ?? true; + const noteDiscoverable = (noteValue.discoverable as boolean | undefined) ?? true; if ( (localPost.frontmatter.theme || undefined) !== (noteValue.theme as string | undefined) || (localPost.frontmatter.fontSize || undefined) !== (noteValue.fontSize as number | undefined) || (localPost.frontmatter.fontFamily || undefined) !== - (noteValue.fontFamily as string | undefined) + (noteValue.fontFamily as string | undefined) || + localDiscoverable !== noteDiscoverable ) { return false; } diff --git a/packages/remanso/src/lib/note.ts b/packages/remanso/src/lib/note.ts index 9f8a306..5901ea9 100644 --- a/packages/remanso/src/lib/note.ts +++ b/packages/remanso/src/lib/note.ts @@ -226,6 +226,8 @@ async function buildNoteRecord( record.fontFamily = post.frontmatter.fontFamily; } + record.discoverable = post.frontmatter.discoverable ?? true; + return record; }