| 43 | // the template distinguishes a user profile (`/[userId]`) from other top-level |
| 44 | // pages like `/jobs`. |
| 45 | const typeForPathname = (pathname: string): RecentPageType => { |
| 46 | if (pathname === '/[userId]') { |
| 47 | return 'user'; |
| 48 | } |
| 49 | if (pathname.startsWith('/sources/')) { |
| 50 | return 'source'; |
| 51 | } |
| 52 | if (pathname.startsWith('/squads/')) { |
| 53 | return 'squad'; |
| 54 | } |
| 55 | if (pathname.startsWith('/tags/')) { |
| 56 | return 'tag'; |
| 57 | } |
| 58 | return 'page'; |
| 59 | }; |
| 60 | |
| 61 | // Records the last visited non-post pages for the v2 Home "Recent" section. |
| 62 | // Individual post permalinks (`/posts/[id]`) are skipped — those belong to |