Giter Club home page Giter Club logo

strapi-plugin-sitemap's People

Contributors

boazpoolman avatar daveskybetbot avatar dependabot[bot] avatar higherror avatar ilnytskyi avatar kahrpatrick avatar kibblerz avatar mattwcole avatar melishev avatar msacc avatar pr0gr8mm3r avatar romaingueffier avatar tmclouisluk avatar tripss avatar yasudacloud avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

strapi-plugin-sitemap's Issues

Allow Configuration for Read/Write Directory

Hello πŸ‘‹

I'm wondering whether it would be possible to make the write/read directories configurable rather than hard-coded?

We are building for a AWS Lambda deployment and can only write the to /tmp directory.

With serverless becoming more and more common, maybe others would benefit from this as well?

Develop Branch compatibility

Hi, I'd like to leave you a question, is the development branch compatible with the Strapi v3.6.X?
I'm asking it because as I installed it, there were some dependencies that my project didn't have such as the @strapi/helper-plugin, and after installing these dependencies and building the project again, it didn't open, so, is this branch only available for versions >v4?

Feature request: an ability to exclude last modification date from generated sitemap

Feature request

Summary

Can you and a new option to URL bundles to exclude last modification date for collections.

Why is it needed?

We have a pages on website that receive part of data from Strapi CMS and another part from our own API. In our case last modification date in Strapi CMS is incorrect because our API updates data more frequently and we want to exclude last modification date from sitemap for this pages.

The `/sitemap/xsl/sitemap.xsl` file is Not Found when I try to reach my sitemap `http://localhost:1337/sitemap/index.xml`

Bug report

Describe the bug

The problem is when I try to reach my sitemap through this URL http://localhost:1337/sitemap/index.xml, I got nothing rendered in the browser, and when I check the chrome dev tool network I got this error

Request URL: http://localhost:1337/sitemap/xsl/sitemap.xsl
Request Method: GET
Status Code: 404 Not Found
Remote Address: 127.0.0.1:1337
Referrer Policy: no-referrer

Screenshots

Screenshot 2022-10-24 at 12 50 49

System

  • Node.js version: >=16.16.0 <=18.x.x
  • NPM version: >=6.0.0
  • Strapi version: 4.4.1
  • Plugin version: 2.0.8
  • Database:
  • Operating system: macOS

Additional context

Maybe this is related to the issue when I installed the plugin I had to create a sitemap manually inside the public folder, otherwise, I get an error

2022-10-24 13:25:54.947] error: [strapi-plugin-sitemap]: Something went wrong while trying to write the sitemap XML file to your public folder. Error: ENOENT: no such file or directory, open 'public/sitemap/index.xml'
Error

Plugin configuration not available in Strapi 3.1.1 and 3.1.2

Version

Strapi 3.1.1 & 3.1.2

Steps to reproduce

  • Install plugin, delete build and .cache folders and run yarn build --clean
  • Clean browser cache

What is Expected?

The plugin should be listed in the Admin Dashboard

What is actually happening?

It's not showing so you cannot configure the plugin

Screenshot 2020-07-30 at 21 15 00

Screenshot 2020-07-30 at 21 15 17

Some collection types are not been rendering in the sitemap

I'm using this plugin at a sitemap in my site, but I get a bug:

I set all collection types in the settings:
Screen Capture_select-area_20201129164905

As can be seen, both Tags and Categories are collection types with a valid UID field(slug), but, navigation to the site map, we get this:

<url>
        <loc>https://localhost/pages/education</loc>
        <lastmod>2020-10-20T12:08:32.430Z</lastmod>
        <changefreq>monthly</changefreq>
        <priority>0.8</priority>
    </url>
    <url>
        <loc>https://localhost/pages/work-experience</loc>
        <lastmod>2020-10-31T13:42:22.293Z</lastmod>
        <changefreq>monthly</changefreq>
        <priority>0.8</priority>
    </url>
    <url>
        <loc>https://localhost/pages/about-me</loc>
        <lastmod>2020-10-20T12:42:11.136Z</lastmod>
        <changefreq>monthly</changefreq>
        <priority>0.8</priority>
    </url>
    <url>
        <loc>https://localhost/pages/projects</loc>
        <lastmod>2020-10-18T22:47:14.513Z</lastmod>
        <changefreq>monthly</changefreq>
        <priority>0.8</priority>
    </url>
    <url>
        <loc>https://localhost/pages/posts</loc>
        <lastmod>2020-10-18T22:47:14.658Z</lastmod>
        <changefreq>monthly</changefreq>
        <priority>0.8</priority>
    </url>
    <url>
        <loc>https://localhost/pages/read-the-documentation-fool</loc>
        <lastmod>2020-11-01T14:22:39.533Z</lastmod>
        <changefreq>monthly</changefreq>
        <priority>0.8</priority>
    </url>
    <url>
        <loc>https://localhost/pages/grid-and-flex-layout-making-responsiveness-handling-easier</loc>
        <lastmod>2020-11-01T14:31:31.554Z</lastmod>
        <changefreq>monthly</changefreq>
        <priority>0.8</priority>
    </url>
    <url>
        <loc>https://localhost/pages/home</loc>
        <lastmod>2020-11-01T13:16:42.930Z</lastmod>
        <changefreq>monthly</changefreq>
        <priority>0.8</priority>
    </url>
    <url>
        <loc>https://localhost/</loc>
        <changefreq>monthly</changefreq>
        <priority>1.0</priority>
    </url>

No trace of tags or categories, even though there are at least five records in each.

I tested this both in local and production but i am getting the same result. I thought it could be because of the draft system, but both tags and categories do not use this feature.

What could be the problem then?

PD: there is also another collection type which not use a uid field but i would like to add to the sitemap, is there any way to do that?

Thanks

Allow query params

Right now it is not possible to create a sitemap entry with query params. The input field simply permits typing in a questionmark. e.g.:

  • some-overview?page=2
  • /?location=[id]

Is there any reason for this? Or any workaround?

Thank you!

Remove filter by `published_at` if `Exclude drafts: false` to properly works on collections with turned off Draft/Publish

Bug report

Describe the bug

A clear and concise description of what the bug is.

Steps to reproduce the behavior

  1. Create a collection with turned off Draft/Publish system on collection.
  2. Try to generate sitemap on that collection

Expected behavior

Sitemap is generated

Actual behavior

Error in console
image

System

  • Strapi version: 4.1.0
  • Plugin version: 2.0.6
  • Database: Postgres

Additional context

If remove filter by published_at in core services - works fine. So suggested solution is to check for Exclude drafts config set to false and then not filter by published_at

Unable to add to allowedFields


Edit: I have figured out most of it. I was overlooking that we add the data TYPE to allowed fields, instead of the field names. So now I have the fields available in the settings UI.

The only issue that I am seeing now is there is a many -to-one relation field that (this content type is the "one" part of the relation). The value is not showing in the sitemap, even though everything appears fine in the UI.

Edit 2: After digging through the source code, it appears that relation fields aren't supported. Closing this issue.


I am trying to use this plugin to generate a sitemap and am having an issue when trying to add some fields in the allowedFields section of config.

In config/plugins.js, I have added the following:

module.exports = {
    sitemap: {
      enabled: true,
      config: {
        autoGenerate: true,
        allowedFields: ['id', 'title']
      }
    }
}

Then when I attempt to add a new url bundle using the sitemap settings, I get the following error:

image

The only field that seems to work is "id". I don't know what I am missing here.

Any guidance would be appreciated.

Node version 16.13.0
Strapi plugin sitemap: 2.0.6
Strapi: 4.0.7
NPM : 8.1.3
OS: Windows 11
DB: sqlite

Does not work with Container hosted instances

@boazpoolman awesome job, really great plugin. I'm running into a problem with hosting it in a container though. Most of the plugins for strapi get added to either /api or /extensions, but this one doesn't. I suspect that it is saving everything under the local node_modules folder? This then becomes an issue when packaged since the routes added to save configs don't get packaged, so you can't update once in the container.

Looking for thoughts on how to get around this. Once I figure that out, I'll be happy to help you add it to the package permanently.

Generate double loc item & miss some of the links in sitemap

Bug report

Describe the bug

I found that there is some links missed and double generate links in sitemap. Links are generated by URL Bundles

a

Settings

URL Bundles
2

In config/plugins.js

module.exports = ({ env }) => ({
  'sitemap': {
    enabled: true,
    config: {
      autoGenerate: true,
      allowedFields: ['id', 'uid', 'slug'],
      excludedTypes: [],
    },
  },
  publisher: {
    enabled: true,
  },
});

Expected behavior

No duplicated loc items and all item in URL Bundles should be generated

System

  • Node.js version: 14
  • Strapi version: 4.0.7
  • Plugin version: 2.0.6
  • Database: Postgresql 13
  • Operating system:

not able to add more field types to the allowedFields in config/plugins.js

Bug report

Describe the bug

I am trying to add the 'text' field type to allowedFields, by adding 'text' to the allowed fields array in config/plugins.js. however the UI in Strapi does not update to make 'text' fields available in the dropdown.

Steps to reproduce the behavior

  1. Add the below code to config/plugins.js
    module.exports = ({ env }) => ({ sitemap: { enabled: true, config: { autoGenerate: true, allowedFields: ['id', 'uid', 'text'], excludedTypes: [], } } })
  2. Open Strapi dashboard
  3. Under 'Plugins', click 'Sitemap'
  4. Add or edit an existing collection that has a text field type
  5. Under UID Field, note that 'text' field types are not available

Expected behavior

After adding 'text' to the allowedFields array in the config/plugins.js file I would expect this field to be available in the UID Field dropdown in Strapi.

Code snippets

module.exports = ({ env }) => ({ sitemap: { enabled: true, config: { autoGenerate: true, allowedFields: ['id', 'uid', 'text'], excludedTypes: [], } } })

System

  • Node.js version: 12.21.0
  • NPM version: 6.14.11
  • Strapi version: 3.6.1
  • Plugin version: 1.2.5
  • Database: mysql 2.18.1
  • Operating system: MacOS Monterey

Pattern: relations array

Feature request

Summary

As of #75 you can add relation fields to the URL pattern like so:

/test/[relation.field]/[id]

Though this only works for single relations. If the relation would be of target *ToMany we wouldn't know which entity to query exactly.

Suggested solution(s)

We should allow the pattern to be written like this to select a specific item of an array of relations.

/test/[relation[1].field]/[id]

Here we would select the second entity on the relations array.

Batched sitemap generation

Feature request

Summary

Generate the sitemap XML in batches.

Why is it needed?

So that you Strapi app won’t timeout when you are tryinh to build a sitemap with a lot URLs.

Suggested solution(s)

Register some kind of queue of batches where each batch would add e.g. 10.000 URLs to the sitemap. This queue will then run in the background.

Related issue(s)/PR(s)

#83

Error "Javascript heap out of memory"

Bug report

Describe the bug

can't see any notification of sitemap is generating when pressing the button there is no info that how much time it will take or its generating the sitemap

Steps to reproduce the behavior

  1. Go to 'sitemap plugin'
  2. add URL bundle and save
  3. and generate sitemap
  4. you will see no notification is there that sitemap is generating

Expected behavior

It should show that sitemap is generating

System

  • Node.js version: V14.17
  • NPM version: 8.5
  • Strapi version: 4.1.7
  • Plugin version:2.0.7
  • Database:postgress
  • Operating system: ubuntu

Throws error when i18n plugin is not installed

Bug report

Describe the bug

If I don't have the i18n plugin installed, the sitemap plugin throws the following error when I access the plugin page in the admin panel:

error: Model plugin::i18n.locale not found

Steps to reproduce the behavior

  1. Setup a strapi instance without i18n plugin installed
  2. Navigate to the sitemap settings
  3. See error banner pop up and notice error in console output.

Expected behavior

No error is thrown, missing i18n plugin is ignored.

Even better would be, if the plugin just hid all the i18n-related settings. Just a nice to have.

System

(Shouldn't matter)

  • Node.js version: v14.18.2
  • NPM version: 6.14.15
  • Strapi version: 4.0.0
  • Plugin version: 2.0.0
  • Database: sqlite
  • Operating system: Linux

Plugin settings section not visible in Strapi v4.1.12

Bug report

Description

Can't find/see the plugin settings in the admin panel after installation of the plugin, rebuilding en restarting. The plugin seems to be added and present in the plugins overview.

Steps to reproduce the behavior

  1. In the root of the Strapi folder install with npm npm install strapi-plugin-sitemap --save
  2. Rebuild and restart Strapi in develop mode
  3. Check the plugins section, which shows the Sitemap is present
  4. Can't find the settings page for this plugin

Expected behavior

Find the settings section of this plugin in the Settings page of Strapi

Screenshots

Screenshot 2022-06-17 at 10 34 48

Screenshot 2022-06-17 at 10 34 17

System

  • Node.js version: 14.15.0
  • NPM version: 8.12.1
  • Strapi version: 4.1.12
  • Plugin version: 2.0.8
  • Database: Postgress
  • Operating system: MacOSX with Firefox browser

Feature Request: Add support for sitemapindex

Feature request

Summary

Please add support for the sitemapindex.

Why is it needed?

We generally split our sitemaps using a global sitemap index, which loads the site's sub-sitemaps.

This makes it easier to request a re-indexing from search engines, and allows to combine the sitemap of a global site from different sub-site.

Suggested solution(s)

For instance, instead of the existing custom URLs, a separate front-end could generate its own routes-based sitemap, and in Strapi we could request the inclusion of this specific sitemap.

Related issue(s)/PR(s)

N/A

Using no prefix (`/[slug]`) resolve to broken url

Bug report

Describe the bug

When we use a pattern like /[uri] which can contain /, the resolved url does not contain the hostname

Steps to reproduce the behavior

  1. Go to http://127.0.0.1:1337/admin/plugins/sitemap
  2. Add a URL Bundle with a pattern like /[uri]
  3. Set a hostname in settings like http://localhost:3000/ (or http://localhost:3000)
  4. Save
  5. Create an entity with /foo/bar as uri
  6. Generate sitemap

Expected behavior

The url should contain the hostname

Screenshots

image

Additional context

Adding any string in the pattern before the brackets like /foo/[slug] or /foo/bar/[id] works

Go to the Sitemap navigates to Localhost instead domain server

Bug report

Describe the bug

The Go to the Sitemap navigate to http://localhost:4000/sitemap/index.xml instead of the live domain

Steps to reproduce the behavior

  1. Go to 'Strapi Admin'
  2. Click on 'Sitemap'
  3. Click on 'Go to the Sitemap'
  4. New Window is opened
  5. Page navigates to http://localhost:4000/sitemap/index.xml

Expected behaviour

The page should be navigated to https://admin.cgafrica.com/sitemap/index.xml

Screenshots

If applicable, add screenshots to help explain your problem.

Code snippets

If applicable, add code samples to help explain your problem.

System

  • Node.js version:
  • NPM version: 6.0.0
  • Strapi version: 4.03
  • Plugin version:2.0.4
  • Database: sql
  • Operating system:

Additional context

Add any other context about the problem here.

add trailing slash

hi, I want to add a trailing slash at the end of my routes.
how can I do that? thanks.

Support URLs containing slashes

Currently the plugin assumes that all Strapi pages are at the root of the site. URLs like https://my-site.com/articles/my-strapi-article-1 are not supported because the UID field used in the sitemap doesn't allow slashes. Custom entries have the same problem. I had a go at a solution here that adds an area property to the settings for both custom and collection entries. Let me know what you think.

image

Unable to generate sitemap when collection names have a space

I am currently unable to generate the sitemap if my collection name has a space (We have done this for it to be human readable on the CMS itsself, annoyingly strapi does not allow for seperate display and data names..)

This is an example of a collection model that does not work:

{ "kind": "collectionType", "connection": "default", "collectionName": "help_article", "info": { "name": "Help Article" }, "options": { "increments": true, "timestamps": true }, "attributes": { "Url slug": { "type": "string" }, "Article title": { "type": "string" }, "Image": { "model": "file", "via": "related", "plugin": "upload" }, "Sub title": { "type": "string" }, "Blurb": { "type": "string" }, "Content": { "type": "richtext" }, "Page title (head tag)": { "type": "string" }, "Page description (head tag)": { "type": "string" } } }

We believe it blows up on this line

Thanks for any help on this!

Plugin Admin Page breaks after sitemap.xml is generated

Bug report

Describe the bug

After generating sitemap, plugin admin page breaks and shows white page.

When I build strapi, it is built as production thus I could not resolve where the error originated from.

Steps to reproduce the behavior

  1. install strapi-plugin-sitemap: 2.0.9
  2. build strapi
  3. run strapi develop
  4. generate sitemap using plugin (any content) with pre generated contents.

Expected behavior

Plugin admin page(/admin/plugins/sitemap) shows that current xml is loaded.

Screenshots

Code snippets

System

  • Node.js version: node 16.17.1
  • NPM version: 8.15.0
  • Strapi version: 4.5.2
  • Plugin version: 2.0.9
  • Database: PostgreSQL
  • Operating system: MacOS Ventura (13.1)

Additional context

Important note : after downgrading this plugin to 2.0.8, things work properly.

probably these changes are inducing the error. (2.0.8 vs 2.0.9)

2.0.8...2.0.9

Multilingual support

With the release of Strapi 3.6.0 we are now able to translate our pages.
Multiple languages means multiple URLs.
We should implement this throughout the sitemap based on Google's guidelines: Multilingual sitemaps

Unexpected token '.' error when deploying to GCP App Engine

Bug report

Describe the bug

Hi there,
After I set up the sitemap plugin, I cannot deploy the code to the Google Cloud Platform App Engine.
This is the error I'm having.

> strapi start
[2021-12-21 01:52:20.738] debug: \u26d4\ufe0f Server wasn't able to start properly.
[2021-12-21 01:52:20.742] error: Could not load js config file /app/node_modules/strapi-plugin-sitemap/strapi-server.js: Unexpected token '.'
Error: Could not load js config file /app/node_modules/strapi-plugin-sitemap/strapi-server.js: Unexpected token '.'
    at loadJsFile (/app/node_modules/@strapi/strapi/lib/core/app-configuration/load-config-file.js:18:11)
    at loadFile (/app/node_modules/@strapi/strapi/lib/core/app-configuration/load-config-file.js:35:14)
    at Object.loadPlugins (/app/node_modules/@strapi/strapi/lib/core/loaders/plugins/index.js:109:26)
    at async Strapi.loadPlugins (/app/node_modules/@strapi/strapi/lib/Strapi.js:279:5)
    at async Promise.all (index 1)
    at async Strapi.register (/app/node_modules/@strapi/strapi/lib/Strapi.js:311:5)
    at async Strapi.load (/app/node_modules/@strapi/strapi/lib/Strapi.js:409:5)
    at async Strapi.start (/app/node_modules/@strapi/strapi/lib/Strapi.js:161:9)

Any Idea?

System

  • Node.js version: v14.17.2
  • NPM version: 6.14.13
  • Strapi version: 4.0.0
  • Plugin version: 2.0.2
  • Database: Postgres 13
  • Operating system: Linux

CLI to generate sitemap from the command line

Feature request

Summary

Have a strapi-sitemap CLI with a generate command so you can generate the sitemap XML from the CLI.

Why is it needed?

This is useful when using a loadbalancer with multiple Strapi instances.
Generating sitemap in each instance separately can cause problems (performance and race-conditions).

So when having a CLI you can disable auto generation and have a special worker dedicated to generating the sitemap.

Related issue(s)/PR(s)

#84

Use of non UID type field

This plugin has been written to use UID type fields as URLs to build the sitemap xml.
Potentially we could use a non UID field as (part of the) URL, to use the ID field for example.

This is kind of an interest check. If this is something you would like to see, let me know in this issue.
If this is highly requested I will update the plugin.

404 when trying to access the settings

Hello,
First time I'm using the plugin and I'm struggling with it.
I have a 404 when I try to go to the plugin settings

Capture d’écran 2021-11-20 aΜ€ 11 16 51

I'm using an old version of strapi : "strapi": "3.0.0-beta.20",
Not sure it's supported ?

Also not sure how to generate the site map once you added settings. I used postman and the routes to populate my settings (not sure it's correct, and the hostname is not populating).
Capture d’écran 2021-11-20 aΜ€ 11 29 18
Capture d’écran 2021-11-20 aΜ€ 11 29 26

Thanks in advance,
Marie

Clearer explanation of the Allowed fields

Feature request

Summary

A clearer explanation of the Allowed fields in the Readme to explain that it is the type of the fields and not the field names

Why is it needed?

At first I thought that this field was an array of the fields names instead of being their types, so I filled with the names that I wanted for the sitemap to be generated with.
When it didn't work, I searched through the source code to understand why it doesn't work and found it that this array was instead a list of types to be included.

Suggested solution(s)

Make it clearer that it is a list of types. I know that it is said that way in the Readme, but it is not very clear what it is.
Maybe include an example of an array that is not only ["id", "uid"], but also something like ["id", "string"].

Sorry if this feels a bit much, but I was almost being discouraged of using this plugin as I thought that there was a bug inside.

Related issue(s)/PR(s)

[Question] Single collection type

Hey, I use version 2.0.8 of this package and I wonder if there is a way to add a single collection type under URL bundles? For example, right know I can't add something like "about", which is a single page/single collection type, with the URL /about.

The only solution seems to add it under "custom URLs" or am I missing something?

Error: Cannot read property 'attributes' of undefined

I am receiving Cannot read property 'attributes' of undefined when I click "Add" or "edit"
image

Both of collections have UID field. I'm also new to strapi so I might do something wrong. Using latest version.

EDIT: Also reciving error when deleting all and pressing "add 1 by 1"
image

Some sc of error:
image
image

Generate sitemap when server boots

Feature request

Summary

To generate a sitemap when the server boots

Why is it needed?

We run Strapi in Google Cloud Run, these scale to zero so now sometimes when we retrieve the sitemap it does not exist, creating one on boot would solve this.

Suggested solution(s)

When the server boots to also create an sitemap.

Related issue(s)/PR(s)

#84

Default locale

Bug report

First of all, this plugin is amazing. Thank you for working on this!

Describe the bug

The current behavior is kind of random - the content type sometimes appears in a locale as default and other times with another. That affects how the pages are ranked.

Steps to reproduce the behavior

  1. Install the plugin
  2. Add multiple contents with multiple locales
  3. Open the sitemap and see the default URL is not always in the same locale

Expected behavior

The content using the default locale should always be used as the default URL.

Screenshots

Notice that the default URL for the https://croct.com/blog/pt-br/post/perfil-progressivo appears as pt-br while for https://croct.com/blog/post/ultimate-guide-ab-testing-analysis is en-us (the correct is en-us, as it's the default locale).

image

System

image

Progress indicator for sitemap generations

Feature request

Summary

When you generate a large sitemap it can take some time. We should show some kind of progress indicator to show you the progress of building the sitemap XML.

Why is it needed?

Because otherwise the developer is waiting for a long time and doesn't know what's going on.

Suggested solution(s)

Some kind of progress indicator that shows you a percentage of how far the sitemap build is.

Related issue(s)/PR(s)

#83

Strapi Build fails having this plugin for @strapi/strapi v.4.5.5

Strapi Build fails having this plugin for @strapi/strapi v.4.5.5

Description

With the strapi version v.4.5.5 , after updating core strapi packages. Trying to build the strapi project dosn't work.

Steps to reproduce the behavior

  1. Upgrade all of the Strapi packages version numbers in package.json to the latest stable Strapi version:
{
  "dependencies": {
    "@notum-cz/strapi-plugin-content-versioning": "^0.4.7",
    "@palmabit/strapi-app-version": "^1.1.0",
    "@strapi/plugin-graphql": "^4.5.5",
    "@strapi/plugin-i18n": "^4.5.5",
    "@strapi/plugin-seo": "^1.7.7",
    "@strapi/plugin-users-permissions": "^4.5.5",
    "@strapi/strapi": "^4.5.5",
    "better-sqlite3": "^8.0.1",
    "strapi-plugin-comments": "^2.2.1",
    "strapi-plugin-duplicate-button": "^1.0.4",
    "strapi-plugin-preview-button": "^1.0.1",
    "strapi-plugin-publisher": "^1.1.4",
    "strapi-plugin-sitemap": "^2.0.8",
    "strapi-plugin-slugify": "^2.3.2"
  }
}
  1. Execute the build command npm run build

Expected behavior

Plugin should be working fine after updating

Output Error

ModuleNotFoundError: Module not found: Error: Can't resolve '@fortawesome/react-fontawesome' in '/home/woozi/work/admire/2022/karthikaspices/website/backend-karthika/node_modules/strapi-plugin-sitemap/admin/src/components/PluginIcon'

System

  • Node.js version: v14.21.2
  • NPM version: 6.14.17
  • Strapi version: "@strapi/strapi": "^4.5.5"
  • Plugin version: "strapi-plugin-sitemap": "^2.0.8"
  • Database: "better-sqlite3": "^8.0.1"
  • Operating system: Ubuntu 22.04.1 LTS x86_64

[BUG] Error with Strapi 4.3.2

Bug report

Describe the bug

Somehow, when trying to get into the Sitemap view we are getting this problem:

[2022-08-07 23:30:00.122] error: [strapi-plugin-sitemap]: Something went wrong while trying to build the SitemapStream. TypeError [ERR_INVALID_URL]: Invalid URL: 
[2022-08-07 23:31:00.132] error: [strapi-plugin-sitemap]: Something went wrong while trying to build the SitemapStream. TypeError [ERR_INVALID_URL]: Invalid URL: 
[2022-08-07 23:32:00.149] error: [strapi-plugin-sitemap]: Something went wrong while trying to build the SitemapStream. TypeError [ERR_INVALID_URL]: Invalid URL: 
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
Error
    at Object.createSitemap (/srv/app/node_modules/strapi-plugin-sitemap/server/services/core.js:248:11)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
Error
    at Object.createSitemap (/srv/app/node_modules/strapi-plugin-sitemap/server/services/core.js:248:11)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
Error
    at Object.createSitemap (/srv/app/node_modules/strapi-plugin-sitemap/server/services/core.js:248:11)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
Error
    at Object.createSitemap (/srv/app/node_modules/strapi-plugin-sitemap/server/services/core.js:248:11)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
Error
    at Object.createSitemap (/srv/app/node_modules/strapi-plugin-sitemap/server/services/core.js:248:11)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
Error
    at Object.createSitemap (/srv/app/node_modules/strapi-plugin-sitemap/server/services/core.js:248:11)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
Error
    at Object.createSitemap (/srv/app/node_modules/strapi-plugin-sitemap/server/services/core.js:248:11)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
Error
    at Object.createSitemap (/srv/app/node_modules/strapi-plugin-sitemap/server/services/core.js:248:11)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
Error
    at Object.createSitemap (/srv/app/node_modules/strapi-plugin-sitemap/server/services/core.js:248:11)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
Error
    at Object.createSitemap (/srv/app/node_modules/strapi-plugin-sitemap/server/services/core.js:248:11)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
Error
    at Object.createSitemap (/srv/app/node_modules/strapi-plugin-sitemap/server/services/core.js:248:11)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
(node:95) Warning: [deprecated] In future versions, Strapi will stop reading directly from the environment variable API_TOKEN_SALT. Please set apiToken.salt in config/admin.js instead.
For security reasons, keep storing the secret in an environment variable and use env() to read it in config/admin.js (ex: `apiToken: { salt: env('API_TOKEN_SALT') }`). See https://docs.strapi.io/developer-docs/latest/setup-deployment-guides/configurations/optional/environment.html#configuration-using-environment-variables.
(Use `node --trace-warnings ...` to show where the warning was created)
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
Error
    at Object.createSitemap (/srv/app/node_modules/strapi-plugin-sitemap/server/services/core.js:248:11)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
Error
    at Object.createSitemap (/srv/app/node_modules/strapi-plugin-sitemap/server/services/core.js:248:11)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
Error
[2022-08-07 23:33:00.198] error: [strapi-plugin-sitemap]: Something went wrong while trying to build the SitemapStream. TypeError [ERR_INVALID_URL]: Invalid URL: 
[2022-08-07 23:34:00.188] error: [strapi-plugin-sitemap]: Something went wrong while trying to build the SitemapStream. TypeError [ERR_INVALID_URL]: Invalid URL: 
[2022-08-07 23:35:00.187] error: [strapi-plugin-sitemap]: Something went wrong while trying to build the SitemapStream. TypeError [ERR_INVALID_URL]: Invalid URL: 
[2022-08-07 23:36:00.152] error: [strapi-plugin-sitemap]: Something went wrong while trying to build the SitemapStream. TypeError [ERR_INVALID_URL]: Invalid URL: 
[2022-08-07 23:37:00.161] error: [strapi-plugin-sitemap]: Something went wrong while trying to build the SitemapStream. TypeError [ERR_INVALID_URL]: Invalid URL: 
[2022-08-07 23:38:00.151] error: [strapi-plugin-sitemap]: Something went wrong while trying to build the SitemapStream. TypeError [ERR_INVALID_URL]: Invalid URL: 
[2022-08-07 23:38:10.917] info: File created: /srv/app/docker-compose.yaml
Starting the compilation for TypeScript files in /srv/app
The server is restarting

[2022-08-07 23:39:23.680] info: --------  MIGRATION STARTED  --------
[2022-08-07 23:39:23.702] warn: No migration directory found.
[2022-08-07 23:39:23.703] info: --------  MIGRATION FINISHED  --------
[2022-08-07 23:39:23.741] info: [website builder] manual trigger enabled

 Project information

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Time               β”‚ Sun Aug 07 2022 23:39:24 GMT+0000 (Coordinated … β”‚
β”‚ Launched in        β”‚ 27742 ms                                         β”‚
β”‚ Environment        β”‚ development                                      β”‚
β”‚ Process PID        β”‚ 95                                               β”‚
β”‚ Version            β”‚ 4.3.2 (node v14.20.0)                            β”‚
β”‚ Edition            β”‚ Community                                        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

 Actions available

Welcome back!
To manage your project πŸš€, go to the administration panel at:
http://localhost:1337/admin

To access the server ⚑️, go to:
http://localhost:1337

[2022-08-07 23:40:00.154] error: [strapi-plugin-sitemap]: Something went wrong while trying to build the SitemapStream. TypeError [ERR_INVALID_URL]: Invalid URL: 
[2022-08-07 23:41:00.162] error: [strapi-plugin-sitemap]: Something went wrong while trying to build the SitemapStream. TypeError [ERR_INVALID_URL]: Invalid URL: 
[2022-08-07 23:42:00.163] error: [strapi-plugin-sitemap]: Something went wrong while trying to build the SitemapStream. TypeError [ERR_INVALID_URL]: Invalid URL: 
[2022-08-07 23:43:00.145] error: [strapi-plugin-sitemap]: Something went wrong while trying to build the SitemapStream. TypeError [ERR_INVALID_URL]: Invalid URL: 
[2022-08-07 23:44:00.157] error: [strapi-plugin-sitemap]: Something went wrong while trying to build the SitemapStream. TypeError [ERR_INVALID_URL]: Invalid URL: 
[2022-08-07 23:45:00.184] error: [strapi-plugin-sitemap]: Something went wrong while trying to build the SitemapStream. TypeError [ERR_INVALID_URL]: Invalid URL: 
[2022-08-07 23:46:00.220] error: [strapi-plugin-sitemap]: Something went wrong while trying to build the SitemapStream. TypeError [ERR_INVALID_URL]: Invalid URL: 
[2022-08-07 23:47:00.184] error: [strapi-plugin-sitemap]: Something went wrong while trying to build the SitemapStream. TypeError [ERR_INVALID_URL]: Invalid URL: 
[2022-08-07 23:48:00.174] error: [strapi-plugin-sitemap]: Something went wrong while trying to build the SitemapStream. TypeError [ERR_INVALID_URL]: Invalid URL: 
[2022-08-07 23:49:00.134] error: [strapi-plugin-sitemap]: Something went wrong while trying to build the SitemapStream. TypeError [ERR_INVALID_URL]: Invalid URL: 
[2022-08-07 23:50:00.162] error: [strapi-plugin-sitemap]: Something went wrong while trying to build the SitemapStream. TypeError [ERR_INVALID_URL]: Invalid URL: 
    at Object.createSitemap (/srv/app/node_modules/strapi-plugin-sitemap/server/services/core.js:248:11)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
Error
    at Object.createSitemap (/srv/app/node_modules/strapi-plugin-sitemap/server/services/core.js:248:11)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
Error
    at Object.createSitemap (/srv/app/node_modules/strapi-plugin-sitemap/server/services/core.js:248:11)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
Error
    at Object.createSitemap (/srv/app/node_modules/strapi-plugin-sitemap/server/services/core.js:248:11)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
Error
    at Object.createSitemap (/srv/app/node_modules/strapi-plugin-sitemap/server/services/core.js:248:11)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
Error
    at Object.createSitemap (/srv/app/node_modules/strapi-plugin-sitemap/server/services/core.js:248:11)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
Error
    at Object.createSitemap (/srv/app/node_modules/strapi-plugin-sitemap/server/services/core.js:248:11)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
Error
    at Object.createSitemap (/srv/app/node_modules/strapi-plugin-sitemap/server/services/core.js:248:11)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
Error
    at Object.createSitemap (/srv/app/node_modules/strapi-plugin-sitemap/server/services/core.js:248:11)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)

This altogether

Steps to reproduce the behavior

  1. Go Sitemap.
  2. Go to the container logs(either in terminal or docker desktop).
  3. Scroll down to find the error.
  4. See an error

Expected behavior

We should not get any error in both the docker logs and the website.

Screenshots

sitemaperror

System

  • Node.js version: 4.3.2 (node v14.20.0)
  • Strapi version: 4.3.2
  • Plugin version: 2.0.8
  • Database: PostgreSQL 13.7
  • Operating system: Alpine Linux v3.16

Additional context

Add any other context about the problem here.

Area/Path for collections can not be set individual

Each time i am changing the area/path for a collection type it's going to be changed for every other collection also which means i can not set individual areas/paths.
Tried already reinstalling the plugin but it seems like the "config file" isn't removed that way.

Feature request: an ability to use the same collection with different patterns

Feature request

Summary

Can you add an ability to specify a few patterns for the same collection?

For example I have collection products and I want to have a few patterns for it. For example:

/products/[id]
/products/[id]/another-slug-1
/products/[id]/another-slug-2

Why is it needed?

A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Suggested solution(s)

There are 2 options for that:

  • If it possible to extend this dialog to have a few patterns (and have priority and changefreq for each pattern)

Screenshot 2022-01-11 at 20 23 38

- Allow to use the same collection a few times for URL bundles (I think this is more preferable way)

Feature Request: Cloud-based sitemap storage

Hello,

Feature request

Thanks for you great work on this beautiful plugin.

For now plugin don't very support cloud-based deployments, and it's will be nice to have it, main problems:

  • if we have multiple instance of strapi launched, there is no way to restrict only one of them to generate sitemap's (e.g. dedicated sitemap generator worker), it can be solved by some CLI command for generate sitemaps
  • would be nice to have automatic sitemap upload to some cloud storages (and way to configure it over config), e.g. gcs or s3
  • there is no way to set sitemap hostname in config (and would be nice to have way to override any settings in config), and deny to change it in admin panel by users

Surgical URL injection / Caching

Feature request

Summary

When you have the autoGenerate setting enabled and you update a piece of content, all the pages that should be included in the sitemap are queried and afterwards added to the sitemap. If you have a larger sitemap is could be a big performance issue.

Why is it needed?

It is probably best to only update the URL of the page you have just created, edited or deleted. So only that page will be queried. We can do this by implementing some kind of caching layer.

Suggested solution(s)

Solution 1:
Create a urls.json file in which you store al the URLs of the sitemap.
You could surgically add, edit or remove URLs from this file and afterwards regenerate the sitemap.xml based on that JSON file.

Solution 2:
Instead of having an extra JSON file that holds the URLs, we could (maby) also just read the URLs from the sitemap.xml file itself and use those to then again regenerate the sitemap.

Relational URL pattern

Feature request

Summary

Allow querying relational fields in the URL pattern like /prefix/[relation.slug_field].

Why is it needed?

For better dynamic URL patterns.

Related issue(s)/PR(s)

#75

GCP / GAE Deployment: No wirteable filesystem

Feature request

Summary

Deploying a strapi-plugin-sitemap project to Google App Engine does not work.
Did anyone got this plugin to work on a GAE?
From my understanding the GAE filesystem is read only. For writing files Google Cloud Storage is recommended. Therefore the plugin can not create nor write to files in the /public/sitemap folder.

Why is it needed?

plugin shall work on GAE

Suggested solution(s)

Provide a setting to change the path of the generated sitemap.
In case of GAE it might be enough to change the path to /tmp/sitemap or to a Google Cloud Link.

Related issue(s)/PR(s)

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

JSON output support

Feature request

Summary

Hello, thank you for an amazing plugin. I have a question - is there any way to get JSON output without XML?

Why is it needed?

Because the frontend side has a different domain name and few frontend-specific routes, such as /terms, privacy, sign in, etc

Suggested solution(s)

JSON output with pagination support for split-sitemaps

URL Bundles not generating for pre-existing collections.

Bug report

URL Bundles not generating for pre-existing collections.

On adding a URL bundle for a pre-existing collection that existed before plugin installation, links are not generated. Links are only generated for new entries made after installation. Duplicating pre-existing content does not generate a link either.

Steps to reproduce the behavior

  1. Create Strapi instance
  2. Create content collections (possibly without a UID field since I didn't have one before making URL bundles)
  3. Populate and publish the content collection
  4. Install sitemap plugin
  5. Create url bundle for the content collection
  6. Save and generate sitemap
  7. See error

Expected behavior

URL's created for the content collection.

System

  • Node.js version: 14.18.2
  • NPM version: 8.3.0
  • Strapi version: 4.0.4
  • Plugin version: 2.0.4

Additional context

Some of the other collections weren't generating either.
For one, I could get them generated by editing and saving content.
For another, I had to duplicate the content and delete the old one.
Neither of these worked for the ones created before adding the plugin.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.