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

SEO improvement: change rename image file #1040

Open
3 tasks done
Programmatore-Web opened this issue Apr 10, 2022 · 6 comments
Open
3 tasks done

SEO improvement: change rename image file #1040

Programmatore-Web opened this issue Apr 10, 2022 · 6 comments
Labels
enhancement New feature or request

Comments

@Programmatore-Web
Copy link

Is your feature request related to a problem? Please describe.

SEO improvement: change rename image file.

Describe the solution you'd like

I propose to replace the renaming of the image files like this: original-name-random-number.extension.
Can anyone tell me where to look in the files?
Thanks.

Describe alternatives you've considered

No response

Additional context

No response

Validations

@austintoddj
Copy link
Owner

The UploadsController handles storing images.

How does your proposition improve SEO?

@Programmatore-Web
Copy link
Author

SEO specialists argue that the filename must match the keyword.
Then:
original-name = keyword
random-number = avoid replacing an existing file.

A better solution would be:
title-post / keyword.ext.

@austintoddj
Copy link
Owner

Thanks for the suggestion. Drop any links here that support that hypothesis.

I'll see about adding this to the v7 features.

@austintoddj austintoddj added the enhancement New feature or request label Apr 10, 2022
@Programmatore-Web
Copy link
Author

I tried this solution.

    public function store()
    {
        $payload = request()->file();

        if (! $payload) {
            return response()->json(null, 400);
        }

        // Only grab the first element because single file uploads
        // are not supported at this time
        $file = reset($payload);

        $name = time() . '-' . $file->getClientOriginalName();

        //$path = $file->storePublicly(Canvas::baseStoragePath(), [
        //    'disk' => config('canvas.storage_disk'),
        //]);

        $path = $file->storeAs(Canvas::baseStoragePath(), $name);

        return Storage::disk(config('canvas.storage_disk'))->url($path);
    }

@Programmatore-Web
Copy link
Author

Search Engine Optimization (SEO) Starter Guide

Immagine 2022-06-19 114037

@austintoddj
Copy link
Owner

austintoddj commented Jun 27, 2022

Thanks for that @ServizioWebmaster. I'll get this addition in the next major release.

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

2 participants