Skip to content

Add dynamic navigation generation based on navCount#59

Merged
Josephat-S merged 1 commit into
devfrom
feat/dynamic-navigation-based-on-navcount
May 25, 2026
Merged

Add dynamic navigation generation based on navCount#59
Josephat-S merged 1 commit into
devfrom
feat/dynamic-navigation-based-on-navcount

Conversation

@Josephat-S
Copy link
Copy Markdown
Contributor

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 generateNavigation function creates both navigation data and placeholder page components as needed, and templates now import navigation links from a generated nav.ts file.

Key changes:

Dynamic Navigation Generation

  • Added a new module src/navigation.js that defines page pools for each template type and implements the generateNavigation function. This function generates a nav.ts file with navigation items and creates placeholder page components based on user configuration.
  • Updated src/generate.js to call generateNavigation during project generation, before resolving dependencies. [1] [2]

Template Refactoring to Use Generated Navigation

  • Modified all relevant app/layout.tsx and Layout.tsx files in the templates directory (blog, ecommerce, portfolio, saas, school) to import navLinks from the generated nav.ts file instead of defining navigation links inline. [1] [2] [3] [4] [5] [6]
  • Removed hardcoded navLinks arrays from these templates and updated the navigation bar components to use the imported navLinks. [1] [2] [3] [4] [5] [6]

Component and UI Adjustments

  • Refactored navigation bar components in templates to ensure they use the dynamically generated navigation and adjusted some markup for consistency and clarity. [1] [2] [3]

These changes make the navigation structure of generated projects more adaptable and easier to maintain as requirements evolve.

Closes #43

@Josephat-S Josephat-S requested a review from a team May 25, 2026 20:15
@Josephat-S Josephat-S merged commit aff316e into dev May 25, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dynamic Navigation Generation Based on navCount

1 participant