search for standard sites pub-search.waow.tech
search zig blog atproto
11
fork

Configure Feed

Select the types of activity you want to include in your feed.

subscribe to site.standard.document/publication collections

- adds STANDARD_DOCUMENT and STANDARD_PUBLICATION constants
- isDocumentCollection() and isPublicationCollection() helper functions
- TAP now processes both pub.leaflet.* and site.standard.* records
- extractor handles both via textContent (standard) and block parsing (leaflet)

this enables indexing pckt.blog content alongside leaflet.pub

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

zzstoatzz f7a4f0e7 b6dd113e

+21 -6
+21 -6
backend/src/tap.zig
··· 8 8 const indexer = @import("indexer.zig"); 9 9 const extractor = @import("extractor.zig"); 10 10 11 - const DOCUMENT_COLLECTION = "pub.leaflet.document"; 12 - const PUBLICATION_COLLECTION = "pub.leaflet.publication"; 11 + // leaflet-specific collections 12 + const LEAFLET_DOCUMENT = "pub.leaflet.document"; 13 + const LEAFLET_PUBLICATION = "pub.leaflet.publication"; 14 + 15 + // standard.site collections (cross-platform) 16 + const STANDARD_DOCUMENT = "site.standard.document"; 17 + const STANDARD_PUBLICATION = "site.standard.publication"; 18 + 19 + fn isDocumentCollection(collection: []const u8) bool { 20 + return mem.eql(u8, collection, LEAFLET_DOCUMENT) or 21 + mem.eql(u8, collection, STANDARD_DOCUMENT); 22 + } 23 + 24 + fn isPublicationCollection(collection: []const u8) bool { 25 + return mem.eql(u8, collection, LEAFLET_PUBLICATION) or 26 + mem.eql(u8, collection, STANDARD_PUBLICATION); 27 + } 13 28 14 29 fn getTapHost() []const u8 { 15 30 return posix.getenv("TAP_HOST") orelse "leaflet-search-tap.fly.dev"; ··· 135 150 .create, .update => { 136 151 const record_obj = zat.json.getObject(parsed.value, "record.record") orelse return; 137 152 138 - if (mem.eql(u8, rec.collection, DOCUMENT_COLLECTION)) { 153 + if (isDocumentCollection(rec.collection)) { 139 154 processDocument(allocator, uri, did.raw, rec.rkey, record_obj, rec.collection) catch |err| { 140 155 std.debug.print("document processing error: {}\n", .{err}); 141 156 }; 142 - } else if (mem.eql(u8, rec.collection, PUBLICATION_COLLECTION)) { 157 + } else if (isPublicationCollection(rec.collection)) { 143 158 processPublication(allocator, uri, did.raw, rec.rkey, record_obj) catch |err| { 144 159 std.debug.print("publication processing error: {}\n", .{err}); 145 160 }; 146 161 } 147 162 }, 148 163 .delete => { 149 - if (mem.eql(u8, rec.collection, DOCUMENT_COLLECTION)) { 164 + if (isDocumentCollection(rec.collection)) { 150 165 indexer.deleteDocument(uri); 151 166 std.debug.print("deleted document: {s}\n", .{uri}); 152 - } else if (mem.eql(u8, rec.collection, PUBLICATION_COLLECTION)) { 167 + } else if (isPublicationCollection(rec.collection)) { 153 168 indexer.deletePublication(uri); 154 169 std.debug.print("deleted publication: {s}\n", .{uri}); 155 170 }