Show independent note descriptions, tags and image counts without author chrome
wiki CI and deployment / verify-and-deploy (push) Has been cancelled
wiki CI and deployment / verify-and-deploy (push) Has been cancelled
This commit is contained in:
@@ -3,7 +3,7 @@ import { decodeCursor, encodeCursor, type FeedData, type Post, type PostKind, ty
|
||||
import { works } from "../content/registry";
|
||||
const tagTree = `WITH RECURSIVE tree AS (SELECT *,slug::text AS path FROM tags WHERE parent_id IS NULL UNION ALL SELECT t.*,tree.path||'/'||t.slug FROM tags t JOIN tree ON t.parent_id=tree.id) SELECT * FROM tree`;
|
||||
export async function tags(): Promise<Tag[]> { return (await db().query(`${tagTree} ORDER BY path`)).rows; }
|
||||
const expand = `SELECT p.*,
|
||||
const expand = `SELECT p.*,(SELECT count(*)::integer FROM page_snapshots ps WHERE ps.post_id=p.id) AS snapshot_count,
|
||||
COALESCE((SELECT jsonb_agg(ae ORDER BY ae.position) FROM (SELECT a.*,pa.position,pa.role,COALESCE((SELECT jsonb_agg(v.role) FROM asset_variants v WHERE v.asset_id=a.id),'[]') AS variants FROM post_assets pa JOIN assets a ON a.id=pa.asset_id WHERE pa.post_id=p.id) ae),'[]') AS assets,
|
||||
COALESCE((SELECT jsonb_agg(t) FROM tags t JOIN post_tags pt ON pt.tag_id=t.id WHERE pt.post_id=p.id),'[]') AS tags FROM posts p`;
|
||||
function serialize(posts: Post[], allTags: Tag[]): Post[] {
|
||||
|
||||
Reference in New Issue
Block a user