Skip to content

Commit 7e2dfdd

Browse files
committed
fix: remove possible duplicate entries
1 parent 5800442 commit 7e2dfdd

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

CHANGELOG.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9+
10+
## [0.4.3] - 2022-07-28
11+
### Fixed
12+
- Error where sometimes in NextJS duplicate entries were saved in the sitemap.
13+
914
## [0.4.0] - 2021-07-24
1015

1116
### Feature
@@ -66,7 +71,10 @@ First kind of functional version of the package and it also has the ability to h
6671
- Docs and such
6772

6873
[Unreleased]: https://github.com/reecem/prismic-sitemap/compare/v0.3.1...HEAD
69-
[0.4.0]: https://github.com/reecem/prismic-sitemap/compare/v0.4.0...HEAD
74+
[0.4.3]: https://github.com/reecem/prismic-sitemap/compare/v0.4.3...HEAD
75+
[0.4.2]: https://github.com/reecem/prismic-sitemap/compare/v0.4.2...v0.4.3
76+
[0.4.1]: https://github.com/reecem/prismic-sitemap/compare/v0.4.1...v0.4.2
77+
[0.4.0]: https://github.com/reecem/prismic-sitemap/compare/v0.4.0...v0.4.1
7078
[0.3.1]: https://github.com/reecem/prismic-sitemap/compare/v0.3.1...v0.4.0
7179
[0.3.0]: https://github.com/reecem/prismic-sitemap/compare/v0.3.0...v0.3.1
7280
[0.2.0]: https://github.com/reecem/prismic-sitemap/compare/v0.2.0

index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
const generator = require('./generator');
22
const path = require('path');
33

4+
let isRunning = false;
5+
46
module.exports = (nextConfig) => ({
57
...nextConfig,
68
webpack(config, options) {
@@ -11,9 +13,11 @@ module.exports = (nextConfig) => ({
1113
} = options;
1214

1315

14-
if (isServer) {
16+
if (isServer && isRunning == false) {
1517
console.log('[Sitemap Generator]: Generating Sitemap');
1618

19+
isRunning = true;
20+
1721
if (typeof sitemap.publicPath === 'undefined') {
1822
sitemap.publicPath = path.join(options.dir, 'public');
1923
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@reecem/prismic-sitemap",
3-
"version": "0.4.2",
3+
"version": "0.4.3",
44
"description": "Sitemap Generator for Prismic and Next.js with Minimal Configuration",
55
"keywords": [
66
"javascript",

0 commit comments

Comments
 (0)