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

Names for images in meta tags do not get hashed #9167

Closed
axel-zarate opened this issue Jul 31, 2023 · 3 comments
Closed

Names for images in meta tags do not get hashed #9167

axel-zarate opened this issue Jul 31, 2023 · 3 comments

Comments

@axel-zarate
Copy link

🐛 bug report

When adding an Open Graph meta tag with content set to an image path, the image name is not hashed when running serve or build commands. If other HTML elements (such as img) have the same path, they will also result in an unhashed path after build.

🎛 Configuration (.babelrc, package.json, cli command)

Default config.

🤔 Expected Behavior

When using a tag such as:

<meta property="og:image" content="./img/logo.jpg" />

It should result in something similar to:

<meta property="og:image" content="/logo.8a6a7831.jpg" />

with the corresponding renaming of the actual file.

😯 Current Behavior

The image name remains the same:

<meta property="og:image" content="/img/logo.jpg" />

and the file is copied to the output directory as is, even with subfolders.

💁 Possible Solution

Unfortunately, I don't know enough about the inner workings of Parcel to make a suggestion.

💻 Code Sample

Simple HTML file. Parcel freshly installed with no custom configuration:

<html lang="en">
  <head>
    <meta charset="utf-8" />
    <title>My Parcel App</title>
    <meta property="og:image" content="./img/logo.jpg" />
  </head>
  <body>
    <img src="./img/logo.jpg" alt="Logo">
  </body>
</html>

🌍 Your Environment

Software Version(s)
Parcel 2.9.3
Node 16.19.0
npm/Yarn 9.4.2/1.22.19
Operating System Windows 10
@devongovett
Copy link
Member

I think this was intentional? Some services require the open graph image urls to be stable I believe.

Copy link

github-actions bot commented Mar 9, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs.

@github-actions github-actions bot added the Stale Inactive issues label Mar 9, 2024
@esfomeado
Copy link

Any update regarding this issue?

@github-actions github-actions bot removed the Stale Inactive issues label Dec 20, 2024
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

No branches or pull requests

3 participants