-
Notifications
You must be signed in to change notification settings - Fork 4
feat(posts): add categories and tags pages for post navigation #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements new navigation routes and pages to support filtering posts by categories and tags. Key changes include:
- Adding new menu routes for CATEGORIES and TAGS.
- Introducing tag and category pages with pagination and post sorting.
- Updating Contentlayer schema file path patterns to include both .md and .mdx files.
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/constants/menu.ts | Added new routes for categories and tags. |
| src/app/tags/[tag]/page.tsx | Created a root page for tags with pagination support. |
| src/app/tags/[tag]/p/[page]/page.tsx | Implemented the main paginated view for tag-based post lists. |
| src/app/tags/[tag]/p/[page]/page.css.ts | Added styling for tag page title. |
| src/app/posts/page.tsx | Refactored to use the paginated posts component with a new root name. |
| src/app/categories/[category]/page.tsx | Created a root page for categories with pagination support. |
| src/app/categories/[category]/p/[page]/page.tsx | Implemented the main paginated view for category-based post lists. |
| next.config.ts | Removed basePath to support the export configuration. |
| config/contentlayer/schema.ts | Updated file path patterns to support both .md and .mdx files. |
Comments suppressed due to low confidence (1)
src/app/posts/page.tsx:1
- [nitpick] There is an inconsistency between the imported component name 'PostsPage' and the local component name 'PostRootPage'. Consider using a consistent naming convention to avoid potential confusion.
import PostsPage from './p/[page]/page';
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements the navigation pages for posts by tags and categories, including paginated views for each section.
- Implements tag list and paginated tag pages
- Implements category list and paginated category pages
- Refactors post pages naming and updates content layer schema patterns
Reviewed Changes
Copilot reviewed 19 out of 23 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/app/tags/page.tsx | Adds a tag list page displaying unique tags with post counts |
| src/app/tags/page.css.ts | Provides styling for the tag list page |
| src/app/tags/[tag]/page.tsx | Creates a routed tag page that defaults to the first page |
| src/app/tags/[tag]/p/[page]/page.tsx | Implements paginated tag posts with sorting by creation date |
| src/app/posts/page.tsx | Renames and wraps the post list page for consistent routing |
| src/app/posts/p/[page]/page.tsx | Updates the post pagination component with naming adjustments |
| src/app/posts/[slug]/_components/header/index.tsx | Updates category links to use slugified values in post headers |
| src/app/categories/page.tsx | Implements a category list page with counts and navigation links |
| src/app/categories/page.css.ts | Provides styling for the category list page |
| src/app/categories/[category]/page.tsx | Creates a routed category page that defaults to the first page |
| src/app/categories/[category]/p/[page]/page.tsx | Implements paginated category posts with sorting by creation date |
| next.config.ts | Removes the unused basePath configuration |
| config/contentlayer/schema.ts | Updates file path patterns to support additional markdown file extensions |
Files not reviewed (4)
- content/posts/2025-04-19-semantic-v2/post.mdx: Language not supported
- content/posts/2025-04-20-deploy-with-actions/post.mdx: Language not supported
- package.json: Language not supported
- pnpm-lock.yaml: Language not supported
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* feat: add Next.js files * feat: add eslint and prettier configs * build: add contentlayer mdx build system * feat: integrate `vanilla-extract` and implement theme mode with app layout support (#4) * build: add vanilla-extract dependencies * feat: add site metadata and icons * feat: add theme mode and app layout component * chore: apply suggestions from code review * feat: add profile cards and post grid components to the home page (#6) * feat: add profile cards * Update src/app/page.tsx Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix(contentlayer): resolve sync issue and load latest content * feat: add icon components * feat(contentlayer): support both relative paths and URLs for image handling * feat(mainpage): add time display to post grid * fix: move getSortedPosts above usage to prevent runtime error --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * feat(animation): add page transition animations (#7) * style(contentlayer): add custom styles and code highlighting for MDX content (#9) * feat: add h2, h3, h4, h5, h6, list, p tag styles * style(mdx): change li before color * build: add rehype and remark dependencies * Update src/components/ui/mdx-component/styles.css.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * feat(posts): implement list page with pagination and configure `copy-webpack-plugin` for SSG build (#10) * feat: add posts page * feat(posts): add pagination and configure copy-webpack-plugin for SSG build * �ci(workflows): add `labeler` workflow for automatic PR labeling (#11) * ci(workflows): add labeler workflow * fix(ci): update labeler permissions * fix(ci): update labeler permissions * fix(ci): remove concurrency option * fix(ci): update labeler on options * fix(ci): update labeler on options * feat(ci): add checkout job to labeler * fix(ci): update labeler config and workflows * fix(ci): fix v2 option labeler config * fix(ci): change working timing * feat(ci): add concurrency option to labeler workflow * feat(ci): add target branch and remove checkout action * feat(post): structure post page with new components and client-side relative time (#12) * feat: add post page header * feat(post): add back button, footer and recommend components * docs: add `2025-04-20-deploy-with-actions` and fix back button component (#13) * docs: add mdx and fix back button * feat: add cover image props * fix(posts): sort posts before rendering * chore(labeler): add documentation label for content folder and sort rules alphabetically * ci(build): add GitHub Actions workflow for automated deployment (#14) * ci: add build workflow * fix(ci): fix deloy 403 error * chore(ci): change push branch * fix(theme): update theme configuration using next-themes * test(build): change deploy push branch * chore(config): test base path config * fix(config): change to empty string * feat(posts): add categories and tags pages for post navigation (#15) * feat: add categories and tags list pages * feat: add url slugify * feat: add categories and tags index pages * Update src/app/categories/[category]/p/[page]/page.tsx Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix(build): resolve async issue causing build failure on categories/p and tags/p pages * feat(post): add tag list component to header (#16) * feat: add tag list to post header component * chore: add route constants * ci(build): change deploy push branch * build: add husky and lint-staged (#17) --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
No description provided.