@galactiks/sitemap
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -1,2 +0,2 @@ | ||
import { SitemapStream, streamToPromise } from 'sitemap'; | ||
import { SitemapStream, streamToPromise, SitemapIndexStream, } from 'sitemap'; | ||
import { createWriteStream } from 'fs'; | ||
@@ -34,14 +34,6 @@ import { join } from 'path'; | ||
// Generate index sitemap | ||
const indexSitemap = new SitemapStream({ | ||
hostname, | ||
xmlns: { | ||
news: true, | ||
xhtml: true, | ||
image: false, | ||
video: false, | ||
}, | ||
}); | ||
const indexSitemap = new SitemapIndexStream(); | ||
Object.entries(sitemaps).forEach(([type, stream]) => { | ||
const sitemapPath = `/sitemap-${type.toLowerCase()}.xml`; | ||
indexSitemap.write({ url: sitemapPath }); | ||
indexSitemap.write({ url: new URL(sitemapPath, hostname).toString() }); | ||
stream.pipe(createWriteStream(join(destinationDir, sitemapPath))); | ||
@@ -48,0 +40,0 @@ }); |
{ | ||
"name": "@galactiks/sitemap", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "A simple sitemap generator for Galactiks", | ||
@@ -5,0 +5,0 @@ "author": "thegalactiks", |
@@ -1,18 +0,20 @@ | ||
# @galactiks/config | ||
# @galactiks/sitemap | ||
This package allows reading [Galactiks](https://www.galactiks.com) configurations files and get config during website generation. | ||
[![npm](https://img.shields.io/npm/v/@galactiks/sitemap)](https://www.npmjs.com/package/@galactiks/sitemap) | ||
A simple and easy-to-use sitemap generator for [Galactiks](https://www.galactiks.com). | ||
## Installation | ||
Install the `@galactiks/config` package using your preferred package manager: | ||
Install the `@galactiks/sitemap` package using your preferred package manager: | ||
```sh | ||
# npm | ||
npm i @galactiks/config | ||
npm i @galactiks/sitemap | ||
# yarn | ||
yarn add @galactiks/config | ||
yarn add @galactiks/sitemap | ||
# pnpm | ||
pnpm i @galactiks/config | ||
pnpm i @galactiks/sitemap | ||
``` | ||
@@ -19,0 +21,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
31
6088
91