-
-
Notifications
You must be signed in to change notification settings - Fork 10
don't index dev, add opengraph image #26
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
Conversation
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.
Pull Request Overview
This PR prevents the development environment from being indexed and adds an OpenGraph image to improve social sharing.
- Removed the client-only directive from the image loader module.
- Updated metadata in layout and article pages to include OpenGraph images and no-index robots directives.
- Extended AWS configuration to pass a no-index flag via environment variables.
Reviewed Changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/src/image-loader.ts | Removed 'use client' directive, shifting the file's execution context. |
| frontend/src/app/layout.tsx | Added metadataBase, openGraph images, and robots configuration based on environment variables. |
| frontend/src/app/(public-area)/articles/[slug]/page.tsx | Updated metadata generation to include inherited OpenGraph images. |
| frontend/next.config.ts | Configured the custom image loader with unoptimized mode enabled. |
| aws/lib/regional-stack.ts | Introduced a new noIndex prop and added NEXT_PUBLIC_NO_INDEX to the environment variables. |
| aws/lib/environment.ts | Propagated the noIndex property into the environment configuration. |
Files not reviewed (1)
- frontend/Dockerfile: Language not supported
Comments suppressed due to low confidence (1)
frontend/src/image-loader.ts:1
- Verify that the removal of the 'use client' directive is intentional, as this change could affect the runtime context of the imageLoader function if client-side execution was expected.
-'use client';
| @@ -7,6 +7,7 @@ const nextConfig: NextConfig = { | |||
| ? { | |||
| loader: 'custom', | |||
| loaderFile: './src/image-loader.ts', | |||
Copilot
AI
Apr 22, 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.
Ensure that setting 'unoptimized: true' for the custom image loader is a deliberate decision, as it may impact image performance and optimization.
| loaderFile: './src/image-loader.ts', | |
| loaderFile: './src/image-loader.ts', | |
| // Setting `unoptimized: true` because image optimization is handled externally by the CDN. |
| NEXT_PUBLIC_CDN_URL: `https://${s3BucketDistDomainName}/public/frontend`, | ||
| NEXT_PUBLIC_PUBLIC_S3_BUCKET_NAME: publicS3BucketName, | ||
| NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY: props.stripePublishableKey, | ||
| NEXT_PUBLIC_NO_INDEX: props.noIndex ? 'true' : '', |
Copilot
AI
Apr 22, 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.
Consider explicitly setting NEXT_PUBLIC_NO_INDEX to 'false' when props.noIndex is not provided, instead of an empty string, to ensure consistent boolean handling.
| NEXT_PUBLIC_NO_INDEX: props.noIndex ? 'true' : '', | |
| NEXT_PUBLIC_NO_INDEX: props.noIndex ? 'true' : 'false', |
What It Does
Prevents dev from being indexed and adds OpenGraph image.