Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions apps/api/migrations/20261123201237_add_seo_settings/migration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
CREATE TABLE "core_seo_settings" (
"id" integer PRIMARY KEY DEFAULT 1,
"allowIndexing" boolean DEFAULT true NOT NULL,
"blockAiCrawlers" boolean DEFAULT false NOT NULL,
"customRobots" text DEFAULT '' NOT NULL,
"sitemapEnabled" boolean DEFAULT true NOT NULL,
"sitemapMaxUrls" integer DEFAULT 10000 NOT NULL,
"disabledSitemapSources" jsonb DEFAULT '[]' NOT NULL,
"updatedById" integer,
"updatedAt" timestamp DEFAULT now() NOT NULL
);
--> statement-breakpoint
ALTER TABLE "core_seo_settings" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint
ALTER TABLE "core_seo_settings" ADD CONSTRAINT "core_seo_settings_updatedById_core_users_id_fkey" FOREIGN KEY ("updatedById") REFERENCES "core_users"("id") ON DELETE SET NULL;
242 changes: 242 additions & 0 deletions apps/api/migrations/20261123201237_add_seo_settings/snapshot.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,242 @@
{
"type": "diff",
"version": "9",
"dialect": "postgres",
"id": "d185c917-2729-4144-b3d6-9e1b9ba1d3da",
"prevIds": [
"d68f291f-7e91-4b91-b606-bca1ba71055c",
"7453f5c0-b352-419a-bc5e-314a1576c86f"
],
"footprints": [
{
"statementType": "create_table",
"statementTarget": [
"table",
"public",
"core_seo_settings"
],
"writes": [
"s|tbl|public.core_seo_settings",
"n|tbl|public.core_seo_settings",
"e|tbl|public.core_seo_settings",
"n|rel|public.core_seo_settings",
"n|type|public.core_seo_settings",
"n|rel|public.core_seo_settings_pkey"
],
"reads": [
"n|sch|public"
]
},
{
"statementType": "create_fk",
"statementTarget": [
"table",
"public",
"core_seo_settings"
],
"writes": [
"s|fk|public.core_seo_settings.core_seo_settings_updatedById_core_users_id_fkey",
"n|fk|public.core_seo_settings.core_seo_settings_updatedById_core_users_id_fkey",
"e|fk|public.core_seo_settings.core_seo_settings_updatedById_core_users_id_fkey",
"n|con|public.core_seo_settings.core_seo_settings_updatedById_core_users_id_fkey"
],
"reads": [
"n|tbl|public.core_seo_settings",
"n|sch|public",
"n|tbl|public.core_users",
"n|sch|public",
"n|col|public.core_seo_settings.updatedById",
"n|col|public.core_users.id",
"e|uniqueness|public.core_users.id"
]
}
],
"deltas": [
{
"op": "create",
"row": {
"schema": "public",
"name": "core_seo_settings",
"isRlsEnabled": true,
"entityType": "tables"
}
},
{
"op": "create",
"row": {
"schema": "public",
"table": "core_seo_settings",
"name": "id",
"type": "integer",
"typeSchema": null,
"notNull": true,
"dimensions": 0,
"default": "1",
"generated": null,
"identity": null,
"entityType": "columns"
}
},
{
"op": "create",
"row": {
"schema": "public",
"table": "core_seo_settings",
"name": "allowIndexing",
"type": "boolean",
"typeSchema": null,
"notNull": true,
"dimensions": 0,
"default": "true",
"generated": null,
"identity": null,
"entityType": "columns"
}
},
{
"op": "create",
"row": {
"schema": "public",
"table": "core_seo_settings",
"name": "blockAiCrawlers",
"type": "boolean",
"typeSchema": null,
"notNull": true,
"dimensions": 0,
"default": "false",
"generated": null,
"identity": null,
"entityType": "columns"
}
},
{
"op": "create",
"row": {
"schema": "public",
"table": "core_seo_settings",
"name": "customRobots",
"type": "text",
"typeSchema": null,
"notNull": true,
"dimensions": 0,
"default": "''",
"generated": null,
"identity": null,
"entityType": "columns"
}
},
{
"op": "create",
"row": {
"schema": "public",
"table": "core_seo_settings",
"name": "sitemapEnabled",
"type": "boolean",
"typeSchema": null,
"notNull": true,
"dimensions": 0,
"default": "true",
"generated": null,
"identity": null,
"entityType": "columns"
}
},
{
"op": "create",
"row": {
"schema": "public",
"table": "core_seo_settings",
"name": "sitemapMaxUrls",
"type": "integer",
"typeSchema": null,
"notNull": true,
"dimensions": 0,
"default": "10000",
"generated": null,
"identity": null,
"entityType": "columns"
}
},
{
"op": "create",
"row": {
"schema": "public",
"table": "core_seo_settings",
"name": "disabledSitemapSources",
"type": "jsonb",
"typeSchema": null,
"notNull": true,
"dimensions": 0,
"default": "'[]'",
"generated": null,
"identity": null,
"entityType": "columns"
}
},
{
"op": "create",
"row": {
"schema": "public",
"table": "core_seo_settings",
"name": "updatedById",
"type": "integer",
"typeSchema": null,
"notNull": false,
"dimensions": 0,
"default": null,
"generated": null,
"identity": null,
"entityType": "columns"
}
},
{
"op": "create",
"row": {
"schema": "public",
"table": "core_seo_settings",
"name": "updatedAt",
"type": "timestamp",
"typeSchema": null,
"notNull": true,
"dimensions": 0,
"default": "now()",
"generated": null,
"identity": null,
"entityType": "columns"
}
},
{
"op": "create",
"row": {
"schema": "public",
"table": "core_seo_settings",
"name": "core_seo_settings_updatedById_core_users_id_fkey",
"nameExplicit": false,
"columns": [
"updatedById"
],
"schemaTo": "public",
"tableTo": "core_users",
"columnsTo": [
"id"
],
"onUpdate": "NO ACTION",
"onDelete": "SET NULL",
"entityType": "fks"
}
},
{
"op": "create",
"row": {
"schema": "public",
"table": "core_seo_settings",
"name": "core_seo_settings_pkey",
"columns": [
"id"
],
"nameExplicit": false,
"entityType": "pks"
}
}
]
}
2 changes: 1 addition & 1 deletion apps/web/content/docs/content-engine/public-lists.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ A filter needs a field that `publicApi.filterableFields` lists, such as a relati
- **Caching.** The API caches each list read per query and locale, and every publish, edit, unpublish, hide or delete of the content type expires it. TanStack Query keeps its own copy in the browser for `RECORD_STALE_TIME`, which is why a page that writes records invalidates its list.
- **Hidden records.** With [`visibility`](/docs/content-engine/content-visibility#who-can-still-see-it), a signed-in author, editor or moderator also gets the hidden records they may see. Those rows carry `hidden: true`, so mark them, for example with `HiddenIcon` from `@vitnode/core/components/hidden-icon`. That response is `private, no-store` and skips the API cache. A route with a page `cache` serves signed-in visitors the HTML rendered for guests, so refetch the list in the browser under a key that includes the viewer, like the blog's `blogViewerPostsQueryOptions`. For your own counts or queries, combine `contentListHiddenAccess` and `contentPublicListCondition` from `@vitnode/api/content/server`.

Records reach crawlers through their own pages and the [sitemap](/docs/content-engine/seo#sitemap). The sitemap route lists records, not lists, so add the list's own URL, such as `/news`, where your app builds `/sitemap.xml`.
Records reach crawlers through their own pages and the [sitemap](/docs/content-engine/seo#sitemap). The sitemap lists records, not lists, so add the list's own URL, such as `/news`, with `buildApiPlugin({ sitemap: { paths: ["/news"] } })`, as [Sitemap sources](/docs/dev/sitemap-sources#add-plugin-pages) shows.

The blog plugin builds `/blog` and `/blog/category/:slug` from the same pieces with only pages and a category, in `plugins/blog/src/pages/blog-list.ts` and `blog-queries.ts`.

Expand Down
Loading
Loading