Skip to content

chore #2112

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

Closed
Closed

chore #2112

Conversation

codered-lgtm
Copy link
Contributor

@codered-lgtm codered-lgtm commented Apr 7, 2025

Description

This PR fixes 2110

Notes for Reviewers

Signed commits

  • Yes, I signed my commits.

Signed-off-by: codered-lgtm <[email protected]>
Signed-off-by: codered-lgtm <[email protected]>
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @codered-lgtm, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

Summary of Changes

This pull request introduces changes to the way featured images are handled in the _includes/list-posts.html and _layouts/page.html files. The primary goal appears to be to enable support for different images for dark and light themes. It achieves this by adding data-logo-for-dark and data-logo-for-light attributes to the <img> tag, allowing the selection of appropriate images based on the user's theme preference. The PR also includes a conditional check for featured-image-light to use a different image for the light theme if available, falling back to the default featured-image if not.

Highlights

  • Dark/Light Theme Image Support: The changes introduce support for displaying different featured images based on the user's theme (dark or light).
  • HTML Modifications: The <img> tag in _includes/list-posts.html and _layouts/page.html is modified to include data-logo-for-dark and data-logo-for-light attributes.
  • Conditional Logic: Conditional logic is added to check for the existence of featured-image-light and use it if available, otherwise defaulting to featured-image.

Changelog

  • _includes/list-posts.html
    • Modified the <img> tag to include id="logo-dark-light", data-logo-for-dark, and data-logo-for-light attributes.
    • Added conditional logic to use featured-image-light if it exists, otherwise use featured-image for the light theme.
  • _layouts/page.html
    • Modified the <img> tag to include id="logo-dark-light", data-logo-for-dark, and data-logo-for-light attributes.
    • Added conditional logic to use featured-image-light if it exists, otherwise use featured-image for the light theme.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.


A theme's dark or light,
Images change in the night,
Data attributes gleam,
A designer's dream,
Visuals, a delightful sight.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

netlify bot commented Apr 7, 2025

Deploy Preview for mesheryio-preview ready!

Name Link
🔨 Latest commit 81c6cd4
🔍 Latest deploy log https://app.netlify.com/sites/mesheryio-preview/deploys/67f3e909e8f19d000850d67b
😎 Deploy Preview https://deploy-preview-2112--mesheryio-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

The changes introduce the ability to use different images for dark and light modes. The implementation involves adding data-logo-for-dark and data-logo-for-light attributes to the img tag and using these attributes to switch between images based on the user's theme preference. This is a useful feature for improving the user experience on different themes.

Merge Readiness

The code changes seem reasonable. I recommend having another reviewer look at the javascript code that handles the switching of images based on the theme to ensure there are no performance or compatibility issues. I am unable to directly approve the pull request, and users should have others review and approve this code before merging.

Comment on lines +8 to +11
<img
id="logo-dark-light"
data-logo-for-dark="{{- post.featured-image | relative_url -}}"
data-logo-for-light="{%- if post.featured-image-light -%}{{- post.featured-image-light | relative_url -}}{%- else -%}{{- post.featured-image | relative_url -}}{% endif %}" src="{{- post.featured-image | relative_url -}}" alt="" class="featured-image">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Consider adding a descriptive alt attribute to the img tag. This improves accessibility for users who rely on screen readers and provides context when the image cannot be loaded.

Suggested change
<img
id="logo-dark-light"
data-logo-for-dark="{{- post.featured-image | relative_url -}}"
data-logo-for-light="{%- if post.featured-image-light -%}{{- post.featured-image-light | relative_url -}}{%- else -%}{{- post.featured-image | relative_url -}}{% endif %}" src="{{- post.featured-image | relative_url -}}" alt="" class="featured-image">
<img
id="logo-dark-light"
data-logo-for-dark="{{- post.featured-image | relative_url -}}"
data-logo-for-light="{%- if post.featured-image-light -%}{{- post.featured-image-light | relative_url -}}{%- else -%}{{- post.featured-image | relative_url -}}{% endif %}" src="{{- post.featured-image | relative_url -}}" alt="{{ post.title }} Featured Image" class="featured-image">

Comment on lines +10 to +11
data-logo-for-dark="{{- post.featured-image | relative_url -}}"
data-logo-for-light="{%- if post.featured-image-light -%}{{- post.featured-image-light | relative_url -}}{%- else -%}{{- post.featured-image | relative_url -}}{% endif %}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Consider adding a descriptive alt attribute to the img tag. This improves accessibility for users who rely on screen readers and provides context when the image cannot be loaded.

Suggested change
data-logo-for-dark="{{- post.featured-image | relative_url -}}"
data-logo-for-light="{%- if post.featured-image-light -%}{{- post.featured-image-light | relative_url -}}{%- else -%}{{- post.featured-image | relative_url -}}{% endif %}"
data-logo-for-dark="{{- post.featured-image | relative_url -}}"
data-logo-for-light="{%- if post.featured-image-light -%}{{- post.featured-image-light | relative_url -}}{%- else -%}{{- post.featured-image | relative_url -}}{% endif %}"
src="{{- page.featured-image | relative_url -}}" alt="{{ page.title }} Featured Image" class="featured-image">

Copy link

stale bot commented May 7, 2025

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the issue/stale Issue has not had any activity for an extended period of time label May 7, 2025
Copy link

stale bot commented May 15, 2025

This issue is being automatically closed due to inactivity. However, you may choose to reopen this issue.

@stale stale bot closed this May 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/website issue/stale Issue has not had any activity for an extended period of time
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant