Add dynamic navigation generation based on navCount#59
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces dynamic navigation generation to the project scaffolding process. Instead of hardcoding navigation links in template files, navigation menus are now generated based on user configuration, making the templates more flexible and maintainable. The new
generateNavigationfunction creates both navigation data and placeholder page components as needed, and templates now import navigation links from a generatednav.tsfile.Key changes:
Dynamic Navigation Generation
src/navigation.jsthat defines page pools for each template type and implements thegenerateNavigationfunction. This function generates anav.tsfile with navigation items and creates placeholder page components based on user configuration.src/generate.jsto callgenerateNavigationduring project generation, before resolving dependencies. [1] [2]Template Refactoring to Use Generated Navigation
app/layout.tsxandLayout.tsxfiles in thetemplatesdirectory (blog, ecommerce, portfolio, saas, school) to importnavLinksfrom the generatednav.tsfile instead of defining navigation links inline. [1] [2] [3] [4] [5] [6]navLinksarrays from these templates and updated the navigation bar components to use the importednavLinks. [1] [2] [3] [4] [5] [6]Component and UI Adjustments
These changes make the navigation structure of generated projects more adaptable and easier to maintain as requirements evolve.
Closes #43