-
Notifications
You must be signed in to change notification settings - Fork 1
Add enviroment variable #38
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,3 +18,6 @@ | |
| npm-debug.log* | ||
| yarn-debug.log* | ||
| yarn-error.log* | ||
|
|
||
| # Environment variables | ||
| .env | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,5 +1,6 @@ | ||||||
| import React from "react"; | ||||||
| import styles from "./navigator.module.css"; | ||||||
| import useDocusaurusContext from "@docusaurus/useDocusaurusContext"; | ||||||
|
|
||||||
| const baseURL = "/DesignPatternPedia/docs"; | ||||||
|
||||||
| const baseURL = "/DesignPatternPedia/docs"; |
Copilot
AI
Dec 13, 2025
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.
The type assertion for customFields.baseUrl should be added since customFields is typed as Record<string, unknown> in Docusaurus. Consider accessing it as (customFields.baseUrl as string | undefined) to ensure type safety.
| const baseUrlOrDefault = customFields.baseUrl || "/"; | |
| const baseUrlOrDefault = (customFields.baseUrl as string | undefined) || "/"; |
Copilot
AI
Dec 13, 2025
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.
The URL construction logic may produce double slashes when baseUrlOrDefault is "/" (the default). For example, if baseUrlOrDefault is "/", the href will be "/docs/path", which is correct. However, if baseUrlOrDefault is "/repository-name/", the href will be "/repository-name/docs/path", which is also correct. But if baseUrlOrDefault doesn't end with a slash (which violates the documentation), this could produce incorrect URLs. Consider adding validation or a more robust URL joining mechanism.
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.
Missing a period at the end of the sentence. The sentence should end with proper punctuation.