Skip to content

Conversation

josecelano
Copy link
Member

@josecelano josecelano commented Jul 6, 2023

When you click on the torrent list, you are redirected to:

http://localhost:3000/torrent/0c90fbf036e28370c1ec773401bc7620146b1d48

We wanted to add the torrent title to the URL to improve SEO.

http://localhost:3000/torrent/0c90fbf036e28370c1ec773401bc7620146b1d48/test1

This is only one proposal. I've added some alternatives in the issue 102

TODO:

  • Decide which alternative from the proposals here we want to use.
  • Remove duplicate code. The current solution uses the same code for the two routes.
  • We can't use the torrent title directly. We have to URL-encode the title, or even we could add a new "slug" field to the torrent or generate a good slug.
  • Use Nuxt useSeoMeta to add the torrent title to the HTML meta title tag.

@josecelano josecelano linked an issue Jul 6, 2023 that may be closed by this pull request
@josecelano josecelano added the Needs Rebase Base Branch has Incompatibilities label Jul 6, 2023
@josecelano josecelano removed the Needs Rebase Base Branch has Incompatibilities label Jul 26, 2023
When you click on the torrent list you are redirected to:

http://localhost:3000/torrent/0c90fbf036e28370c1ec773401bc7620146b1d48/test1

including the torrent title at the end of the URL in a new URL segment.
For example, this torrent title: ` test--test-&-123 test ` would use
this URL:

http://localhost:3000/torrent/1fc73eb95330bb80251f3fd3b96d1dfd120e81ec/test-test-123-test

Notice the title ` test--test-&-123 test ` has been converted to `test-test-123-test`
The component for the torrent details was ducplicated for the two URLs:

- http://localhost:3000/torrent/1fc73eb95330bb80251f3fd3b96d1dfd120e81ec/test-test-123-test
- http://localhost:3000/torrent/1fc73eb95330bb80251f3fd3b96d1dfd120e81ec

Depending on whether you use the "slug" with the title or not.
Being a torrent title `Sample Title`

Both torrent detail pages (with or without title slug):

- http://localhost:3000/torrent/1fc73eb95330bb80251f3fd3b96d1dfd120e81ec
- http://localhost:3000/torrent/1fc73eb95330bb80251f3fd3b96d1dfd120e81ec/sample-title

have now the HTML title meta tag: `Sample Title - Torrent`
@josecelano josecelano marked this pull request as ready for review July 27, 2023 14:53
@josecelano josecelano requested a review from da2ce7 July 27, 2023 14:55
@josecelano josecelano merged commit 53bef27 into torrust:develop Jul 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Set torrent title in URL

1 participant