-
-
Notifications
You must be signed in to change notification settings - Fork 530
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
docs: add digital ocean page #1237
Conversation
Note Currently processing new changes in this PR. This may take a few minutes, please wait... 📒 Files selected for processing (2)
WalkthroughThe changes include the addition of a new footer link in the Docusaurus configuration file, directing users to documentation on deploying to DigitalOcean. Additionally, a new React component has been introduced in the blog section, providing a comprehensive guide for deploying a static site using DigitalOcean's App Platform. This guide includes structured content with images and step-by-step instructions for users. TypeScript declarations for various image file formats have also been added to enhance type checking and support for image assets in the React application. Changes
Poem
Tip You can customize the tone of the review comments and chat replies.Set the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Beta version released with the last commit 🚀
or
|
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.
Actionable comments posted: 1
🧹 Outside diff range and nitpick comments (4)
docs/src/pages/blog/digital-ocean-app-platform.tsx (4)
5-20
: Consider improving type safety for image imports.Instead of using
@ts-ignore
, consider:
- Adding proper type declarations for static assets
- Using a more type-safe approach for image imports
Create a new file
types/images.d.ts
:declare module '*.webp' { const content: string; export default content; } declare module '*.png' { const content: string; export default content; }
103-106
: Consider removing referral code from the URL.The DigitalOcean URL contains a referral code which might not be appropriate for official documentation.
-<a href="https://www.digitalocean.com/?refcode=0813b3be1161&utm_campaign=Referral_Invite&utm_medium=Referral_Program&utm_source=badge/"> +<a href="https://www.digitalocean.com/">
37-47
: Optimize image loading and improve user experience.Consider enhancing the image loading experience:
- Add loading="lazy" for images below the fold
- Add width and height attributes to prevent layout shifts
- Consider using responsive images with srcset
Example implementation for one image:
<img src={DigitalOceanBanner} alt="DigitalOcean banner" + loading="lazy" + width="800" + height="400" style={{ width: '100%', maxWidth: '100%', height: 'auto', marginBottom: '1rem', }} />Also applies to: 107-117, 121-131, 139-149, 154-164, 168-178, 182-192
25-36
: Consider extracting styles to CSS modules.Inline styles could be moved to a CSS module for better maintainability and reusability.
Create a new file
digital-ocean-page.module.css
:.mainContainer { padding: 2rem; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; width: 100%; overflow-x: hidden; }Then import and use it:
-<main - style={{ - padding: '2rem', - display: 'flex', - flexDirection: 'column', - alignItems: 'center', - justifyContent: 'center', - minHeight: '100vh', - width: '100%', - overflowX: 'hidden', - }} -> +<main className={styles.mainContainer}>
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
⛔ Files ignored due to path filters (4)
docs/static/img/digital-ocean-app-config-1.png
is excluded by!**/*.png
docs/static/img/digital-ocean-app-config-2.png
is excluded by!**/*.png
docs/static/img/digital-ocean-create-resource.png
is excluded by!**/*.png
docs/static/img/digital-ocean-static-site.png
is excluded by!**/*.png
📒 Files selected for processing (2)
docs/docusaurus.config.js
(1 hunks)docs/src/pages/blog/digital-ocean-app-platform.tsx
(1 hunks)
🔇 Additional comments (2)
docs/docusaurus.config.js (1)
160-163
: LGTM! Footer link addition looks good.
The new footer link is properly configured and points to the correct path for the Digital Ocean deployment guide.
docs/src/pages/blog/digital-ocean-app-platform.tsx (1)
1-215
: Overall implementation looks good!
The component is well-structured and provides clear, step-by-step instructions for deploying to DigitalOcean. The content is comprehensive and includes helpful visuals.
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.
LGTM (with one comment about @ts-ignore
), but I'd be fine with making the placement a bit more obvious, other than just on the page footer.
Maybe close to the "powered by" text? Your call if needed.
import DigitalOceanAppConfig2 from '@site/static/img/digital-ocean-app-config-2.png' | ||
// @ts-ignore | ||
import DigitalOceanStaticSite from '@site/static/img/digital-ocean-static-site.png' | ||
// @ts-ignore |
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.
Try adding a react-app-env.d.ts
to the docs/
directory. With that, we can avoid these @ts-ignore
.
declare module '*.png'
declare module '*.svg'
declare module '*.jpeg'
declare module '*.jpg'
declare module '*.webp'
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.
Done, thanks!
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.
Beta version released with the last commit 🚀
or
|
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.
Actionable comments posted: 1
🧹 Outside diff range and nitpick comments (5)
docs/src/pages/blog/digital-ocean-app-platform.tsx (5)
1-2
: Consider using more specific ESLint disable comments.Instead of disabling ESLint rules at the file level, consider:
- Using inline disables for specific instances
- Fixing the underlying issues that require the disables
-/* eslint-disable jsx-a11y/anchor-is-valid */ -/* eslint-disable import/no-unresolved */ +// Add specific disables where needed instead
77-78
: Make the example repository URL more obviously placeholder.The current URL might be confusing for users who might try to copy it directly.
- git remote add origin https://github.com/your-username/your-repo.git + git remote add origin https://github.com/GITHUB_USERNAME/REPOSITORY_NAME.git
95-96
: Consider moving the referral code to configuration.The DigitalOcean referral code should be managed in a configuration file for better maintainability.
144-145
: Clarify build directory information.The documentation assumes
build/
as the output directory, but this might vary based on the framework or configuration. Consider adding a note about common variations.- Specify the build output directory as <code>build/</code>, which is the default output - folder for React projects. + Specify the build output directory. For Create React App projects, this is typically <code>build/</code>. + For Next.js it's <code>out/</code> (with static export), and for Gatsby it's <code>public/</code>.
194-202
: Enhance the support section with more resources.Consider adding:
- Common troubleshooting steps
- Links to DigitalOcean's community forums
- Version compatibility information
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
docs/react-app-env.d.ts
(1 hunks)docs/src/pages/blog/digital-ocean-app-platform.tsx
(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- docs/react-app-env.d.ts
🔇 Additional comments (1)
docs/src/pages/blog/digital-ocean-app-platform.tsx (1)
53-56
: Fix accessibility and improve tooltip example.
The current example uses a non-descriptive anchor text and lacks proper accessibility attributes.
Beta version released with the last commit 🚀
or
|
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.
LGTM
Summary by CodeRabbit
New Features
Documentation
Chores