You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: classify imported documents as posts or pages
SSI imported every static document as a page. Add a document type
classifier that reads plan signals to decide post vs page instead.
- New Static_Site_Importer_Document_Type_Classifier keys off dated
head meta (article:published_time, pubdate, dc.date, ...), a
/YYYY/MM/ URL, or an explicit metadata.post_type from markdown
frontmatter.
- The plan materializer honors the classified post_type, applies the
detected publish date to post_date and post_date_gmt, and reconciles
across both posts and pages so re-imports stay idempotent.
- The site entrypoint and undated documents stay pages, matching
today's behavior, so existing imports are unchanged.
Foundation for a follow-up that turns a dated index into a Query Loop.
Fixes#513
$assert( 'page' === ( $GLOBALS['ssi_plan_posts'][ $home_id ]['post_type'] ?? null ), 'undated entrypoint stays a page by default' );
473
+
$assert( 'post' === ( $GLOBALS['ssi_plan_posts'][ $post_id ]['post_type'] ?? null ) && '2024-03-12 10:00:00' === ( $GLOBALS['ssi_plan_posts'][ $post_id ]['post_date'] ?? null ), 'dated article meta classifies a document as a post with its publish date' );
474
+
$assert( 'post' === ( $GLOBALS['ssi_plan_posts'][ $url_dated_id ]['post_type'] ?? null ), 'hierarchical YYYY/MM route classifies a document as a post' );
475
+
$assert( 'page' === ( $GLOBALS['ssi_plan_posts'][ $blog_about_id ]['post_type'] ?? null ), 'a post-like URL without date evidence stays a page' );
476
+
477
+
// Re-import the same plan without resetting the post store: reconciliation
478
+
// must reuse existing rows and keep both count and post types stable.
$assert( 'post' === ( $GLOBALS['ssi_plan_posts'][ $parented_blog_id ]['post_type'] ?? null ), 'a dated article nested under a page hierarchy still classifies as a post' );
0 commit comments