| 21 | // the template distinguishes a user profile (`/[userId]`) from other top-level |
| 22 | // pages like `/jobs`. |
| 23 | const typeForPathname = (pathname: string): RecentPageType => { |
| 24 | if (pathname === '/[userId]') { |
| 25 | return 'user'; |
| 26 | } |
| 27 | if (pathname.startsWith('/sources/')) { |
| 28 | return 'source'; |
| 29 | } |
| 30 | if (pathname.startsWith('/squads/')) { |
| 31 | return 'squad'; |
| 32 | } |
| 33 | if (pathname.startsWith('/tags/')) { |
| 34 | return 'tag'; |
| 35 | } |
| 36 | return 'page'; |
| 37 | }; |
| 38 | |
| 39 | // Records the last visited non-post pages for the v2 Home "Recent" section. |
| 40 | // Individual post permalinks (`/posts/[id]`) are skipped — those belong to |