Commit a468ab2
authored
feat: add support for premium slug in generateConfig function (#647)
* feat: add support for premium slug in generateConfig function
- Introduced a new condition to handle slugs that include "premium/", allowing for better categorization in the configuration generation process.
* refactor: update CloudPlan import paths across components
- Replaced imports of CloudPlan from "shared/useCloudPlan" to "shared/interface" for consistency and clarity.
- Adjusted related components to ensure proper usage of the updated CloudPlan type definition.
* feat: extend EXTENDS_FOLDERS to include premium plan
- Updated the EXTENDS_FOLDERS constant to include "premium" as a valid CloudPlan option, enhancing the flexibility of the table of contents generation.
- Adjusted the type definition to ensure consistency with the new CloudPlan import.
* feat: add CloudPlan type to path.ts for enhanced configuration
- Imported CloudPlan into path.ts to support additional configuration options.
- Updated the prefix variable type to CloudPlan | undefined for improved type safety in the generateConfig function.
* feat: restructure page creation logic by modularizing create-pages functionality
- Removed the existing create-pages.ts file and replaced it with modular files for creating specific pages: create-docs, create-doc-home, create-cloud-api, create-search, and create-404.
- Introduced an interface file to define common types and constants, enhancing code organization and maintainability.
- Each new file encapsulates the logic for creating its respective page, improving clarity and separation of concerns in the page generation process.
* refactor: simplify prefix determination in generateConfig function
- Replaced multiple conditional checks for slug prefixes with a more concise approach using an array and the find method.
- Maintained the existing logic for handling the dedicated prefix based on the presence of a name, improving code readability and maintainability.
* fix: update template import paths in page creation files
- Adjusted the import paths for template files in create-404, create-cloud-api, create-doc-home, create-docs, and create-search to ensure correct resolution.
- Enhanced consistency across page creation logic by standardizing the path structure.1 parent 504fe1f commit a468ab2
File tree
17 files changed
+435
-388
lines changed- gatsby
- create-pages
- src
- components
- MDXComponents
- templates
17 files changed
+435
-388
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
0 commit comments