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

NFR: Permalinks and/or static redirects (SEO) #689

Open
noone-silent opened this issue Mar 18, 2024 · 0 comments
Open

NFR: Permalinks and/or static redirects (SEO) #689

noone-silent opened this issue Mar 18, 2024 · 0 comments

Comments

@noone-silent
Copy link

noone-silent commented Mar 18, 2024

There are currently two ways to change a link or a redirect. But both are not really writer friendly and with a lot of them would make the project file structure unreadable.

If you change your file structure and you already have put out the links somewhere, you need to make sure old users still find the related content. Else it would result into a 404 and this would have an impact on SEO.

You could create a md file with the old name and have a redirect: XXX inside. This is working, but if you have many such changes, it would make the project unreadable.

Overwrite the route: XXX in the page. This would only generate one route, but that's not what we looking for.

Possible solution:
In the project configuration, add a new field like redirects, like this:

  redirects:
    - old: /some/old/path
      new: /to/new/path
      code: 301
    - old: /some/other/old/path
      new: /other/new/path
      code: 302
    - old: /some/obsolete/path
      code: 410

Probably this should create a .htaccess file with all the redirects.

Permalinks
On a page add a new field permalink. For example:

  permalink: something-short

The permalink is only from the root path like https://retype.mygreat.docs/something-short. Also this field should not contain paths like /here-we/go-to to avoid interfering with generated paths. (EDIT: maybe add a prefix like /permalinks/ and make it a reserved keyword too, so it would be https://retype.mygreatdocs/permalinks/something-short)

On Build this should create HTML files in the root which simply redirect to the correct page. This is not important for SEO, but helps with giving customers a fixed link, without looking up the correct URL.

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

1 participant