Skip to content
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

fix(Docs): Social media OG image URL generation update #5973

Merged
merged 4 commits into from
Mar 30, 2024

Conversation

mrhoodz
Copy link
Contributor

@mrhoodz mrhoodz commented Mar 7, 2024

Overview

What is it?

  • Feature / enhancement
  • Bug
  • Docs / tests / types / typos

Description

The previous implementation used useSignals and useTask$ unnecessarily, which could cause delays in generating the Open Graph (OG) image URL and result in blank OG previews when shared. This pull request introduces an OGImage object that efficiently handles the dynamic OG image generation, leading to faster generation of the image URL and improved performance in creating OG previews.

Use cases and why

    1. One use case
    1. Another use case

Checklist:

  • My code follows the developer guidelines of this project
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • Added new tests to cover the fix / functionality

Copy link

netlify bot commented Mar 7, 2024

👷 Deploy request for qwik-insights pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit b699890

Prettier had formatted the import as  👇

import { type RequestHandler } from '@builder.io/qwik-city';

instead of  👇

import type { RequestHandler } from '@builder.io/qwik-city';
In this updated version of the code, I've further optimized the implementation by encapsulating all the necessary logic within the OGImage object. Unnecessary variables like routeLevel and isBaseRoute have been removed to streamline the code and improve clarity.

Here's a breakdown of the changes:

Encapsulation: All logic related to generating the OpenGraph image URL has been encapsulated within the OGImage object. This approach enhances code organization and makes it easier to manage and maintain.

Simplified Logic: The code now directly extracts the title and subtitle from the provided input and constructs the OpenGraph image URL accordingly. Unnecessary checks and variables have been eliminated, resulting in a more concise and efficient implementation.

URL Generation: The URL generation process remains similar to the previous version, but with improved clarity and reduced complexity. The code now focuses solely on generating the appropriate URL based on the provided title and subtitle.
Copy link
Member

@wmertens wmertens left a comment

Choose a reason for hiding this comment

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

Interesting approach, I like it.

@wmertens wmertens merged commit 7f9763d into QwikDev:main Mar 30, 2024
22 checks passed
@steve8708
Copy link
Contributor

@mrhoodz can you point me to how we can remove the word "qwik" in the qwik logo on the og images? I'm not seeing it in the repo

image

the logo is intended to not have the word "qwik" inside the lightening bolt, I'm happy to fix it just need to be pointed to where

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.

None yet

3 participants