strapi-plugin-sitemap icon indicating copy to clipboard operation
strapi-plugin-sitemap copied to clipboard

[FEAT] Ignore all content types but the created by content type builder, i.e., api content types

Open SalahAdDin opened this issue 2 months ago • 4 comments

Feature request

Summary

Checking the sitemap configuration for the setup of the URLs we find the following content-type hell: image

ExtraContentTypeSitemap

It shows a lot of content types that we don't want to make part of any website.

We manually excluded them, but they are too much for the beginning, and no, it does not only include third-party plugin types:

sitemap: {
    enabled: true,
    config: {
      cron: "* * * * 7",
      xsl: true,
      autoGenerate: false,
      caching: true,
      excludedTypes: [
        "admin::api-token",
        "admin::api-token-permission",
        "admin::transfer-token",
        "admin::transfer-token-permission",
        "admin::permission",
        "admin::role",
        "admin::user",
        "plugin::content-releases.release",
        "plugin::content-releases.release-action",
        "plugin::i18n.locale",
        "plugin::navigation.audience",
        "plugin::navigation.navigation-item",
        "plugin::navigation.navigations-items-related",
        "plugin::navigation.navigation",
        "plugin::sitemap.sitemap",
        "plugin::sitemap.sitemap-cache",
        "plugin::users-permissions.permission",
        "plugin::users-permissions.role",
        "plugin::users-permissions.user",
        "plugin::upload.file",
        "plugin::upload.folder",
      ],
    },
  },

Why is it needed?

As you can see, it is hard for the developer tool and check which content types we need to exclude from the sitemap one by one.

Suggested solution(s)

It would be better either to add a new property includeType or make the plugin check only the API content types, so things get easier, even more, it should only include those types and exclude the types we want from API content types since all plugins and Strapi content types are not public in the most of the cases.

As you can see from the comment yarn strapi content-types:list , the only content types we want to see are the following:

├──────────────────────────────────────────────┤
│ api::about-me.about-me                       │
├──────────────────────────────────────────────┤
│ api::category.category                       │
├──────────────────────────────────────────────┤
│ api::education.education                     │
├──────────────────────────────────────────────┤
│ api::post.post                               │
├──────────────────────────────────────────────┤
│ api::profile.profile                         │
├──────────────────────────────────────────────┤
│ api::project.project                         │
├──────────────────────────────────────────────┤
│ api::tag.tag                                 │
├──────────────────────────────────────────────┤
│ api::work-experience.work-experience         │
└──────────────────────────────────────────────┘

Related issue(s)/PR(s)

Let us know if this is related to any issue/pull request.

SalahAdDin avatar May 07 '24 05:05 SalahAdDin