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: SEO improvements #4572

Open
techfg opened this issue Feb 6, 2025 · 2 comments
Open

feat: SEO improvements #4572

techfg opened this issue Feb 6, 2025 · 2 comments

Comments

@techfg
Copy link
Collaborator

techfg commented Feb 6, 2025

Would like to see the following added to the platform:

  1. Ability to define redirects for both HTTP 301 & 302. For example, let's say routes changed from /blog/* to /news/*, while the site works at the new url, any previous links to blog will no longer work OOB. This not only affects someone with a link (or a site that contains a link to the old urls) but also SEO impacts for google/bing/etc.
  2. Add a "canonical" tag to HTML head element for the current page url
  3. Bonus Item - Auto generate a site map and make available
@zachelrath
Copy link
Contributor

@techfg There are a number of SEO features currently supported.

  1. Redirects are already supported you can define a Route with type: redirect and redirect: /some/other/url, and that will cause a 302 Redirect to be performed when someone accesses that route.
  2. Canonical link tags can already be added to any Route via Route Tags ( tags property). For example, this is the Route definition for the Uesio documentation home route:
name: home
public: true
path: home
view: home
params:
  slug: home
theme: default
title: $Site{title} - Documentation
tags:
  - type: meta
    location: head
    name: description
    content: Home page for ues.io documentation
  - type: link
    location: head
    name: canonical
    content: $Site{url}
  1. Agreed about the need for custom Site Maps - a couple years ago we were discussing allowing you to define a Bot that generates a Site Map, similar to what Next.js supports .

However, we decided then to keep things simple for the time, and just implement a default robots.txt route, which gets you pretty far with SEO without having to define a full site map. What we implemented was this --- by default all Routes are blocked from crawlers, but any publicly-accessible Routes (Routes which your app's Public Profile can access) are marked as allowed, so that crawlers can index them. However, this is enabled on a per-Site basis, since, for example, you wouldn't want your QA/UAT site to be indexed by crawlers, generally you only want your Production site to be crawled. Thus, there is an "Enable SEO" checkbox on Sites, which turns on this behavior.

@techfg
Copy link
Collaborator Author

techfg commented Feb 8, 2025

Thanks @zachelrath, all great info!

  1. Redirects are already supported you can define a Route with type: redirect and redirect: /some/other/url, and that will cause a 302 Redirect to be performed when someone accesses that route.

I think expanding on this to support 301 makes sense. Possibly we minimize the administration of "redirect" routes so that instead of having to have a yaml for every route you want to redirect, we add the ability for glob patterns (or similar) using standard redirect syntax (e.g., think .htaccess type of thing). I can see a situation where users would move an entire set of pages (ues did so recently moving from /blog to /news) so supporting this type of thing en masse seems to make some sense. Thoughts?

2. Canonical link tags can already be added to any Route via Route Tags ( tags property). For example, this is the Route definition for the Uesio documentation home route:

Very cool, didn't realize adding to head like this was possible! Regarding some standard SEO related tags such as description, canonical, etc. possibly it makes sense to consider building in an automated "SEO" concept where if the view could contain an seo block and then we would automatically emit various meta tags with some reasonable defaults (e.g., canonical). This would avoid users having to define canonical (and other types of things we could automatically infer but could be overridden via seo block) on every view. Thoughts?

3. Agreed about the need for custom Site Maps - a couple years ago we were discussing allowing you to define a Bot that generates a Site Map, similar to what Next.js supports .

Makes sense. We could just have an automated route when EnableSitemap is enabled for a site to automatically get a /sitemap-index.xml and /sitemap-#.xml route(s). This gets a little challenging with dynamic routes but similar to what you mention about a bot doing it a la what NextJS does, all possible to accomplish. I think an automated solution, whether it be a bot or just an "automatic" route would be helpful.

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

2 participants