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

[feat] Rename images option on production for SEO #158

Closed
ManasMadrecha opened this issue Jan 24, 2021 · 4 comments
Closed

[feat] Rename images option on production for SEO #158

ManasMadrecha opened this issue Jan 24, 2021 · 4 comments
Labels
enhancement New feature or request

Comments

@ManasMadrecha
Copy link

ManasMadrecha commented Jan 24, 2021

I want to keep the file name of image same as I have saved in my Static folder. But currently it is showing some hash-value in URL after I run generate and start.

I even used the fileNames option given in build in nuxt.config.js file:
img: ({ isDev }) => isDev ? '[path][name].[ext]' : 'img/[contenthash:7].[ext]',

I changed this to:
img: ({ isDev }) => isDev ? '[path][name].[ext]' : 'img/[name].[ext]'

But still images are renamed as hash-value only.
Since, the renamed file name has some path like this "_image/a11cc5.webp", I can assume it is because of nuxt-image module, and thus, above fileNames option will not work.

So,
Is there any option to write inside the ipx option inside image option provided by nuxt-image module? For e.g., fileOutput or toFile?
Something like this:
image: {ipx: {sharp: fileOutput or toFile: "something here"}}

P.S. I am new to Nuxt or even Javascript.

@ManasMadrecha
Copy link
Author

Any update on when will the image renaming option be added, so that image name can be retained for SEO?

~ Thanks in advance for this amazing easy-to-use module.

@ManasMadrecha ManasMadrecha changed the title How to rename images on production? [feat] Rename images option on production for SEO Jan 28, 2021
@retroriff
Copy link

I am also very interested to customize image filenames. Resized images have hash names such as:

  • 484b89.jpeg
  • 324234.jpeg

But it would be preferable to keep the original filenames or the alt text:

  • filename-484b89.jpeg
  • filename-480px.jpeg
  • alt-text-484b89.jpeg

@harlan-zw
Copy link
Contributor

PR for it here #158 right?

@danielroe danielroe added the enhancement New feature or request label Apr 28, 2021 — with Volta.net
@danielroe
Copy link
Member

This should be already implemented in #220.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants