Skip to content

don't index dev, add opengraph image#26

Merged
ccbrown merged 1 commit intomainfrom
dev-no-index-opengraph-image
Apr 22, 2025
Merged

don't index dev, add opengraph image#26
ccbrown merged 1 commit intomainfrom
dev-no-index-opengraph-image

Conversation

@ccbrown
Copy link
Owner

@ccbrown ccbrown commented Apr 22, 2025

What It Does

Prevents dev from being indexed and adds OpenGraph image.

Copilot AI review requested due to automatic review settings April 22, 2025 05:45
Copy link
Contributor

Copilot AI left a 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',
Copy link

Copilot AI Apr 22, 2025

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.

Suggested change
loaderFile: './src/image-loader.ts',
loaderFile: './src/image-loader.ts',
// Setting `unoptimized: true` because image optimization is handled externally by the CDN.

Copilot uses AI. Check for mistakes.
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' : '',
Copy link

Copilot AI Apr 22, 2025

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.

Suggested change
NEXT_PUBLIC_NO_INDEX: props.noIndex ? 'true' : '',
NEXT_PUBLIC_NO_INDEX: props.noIndex ? 'true' : 'false',

Copilot uses AI. Check for mistakes.
@ccbrown ccbrown merged commit af2ca06 into main Apr 22, 2025
3 checks passed
@ccbrown ccbrown deleted the dev-no-index-opengraph-image branch April 22, 2025 05:48
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.

1 participant