Socket
Socket
Sign inDemoInstall

sitemap

Package Overview
Dependencies
Maintainers
1
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sitemap - npm Package Compare versions

Comparing version 2.1.0 to 2.2.0

test_lastmod.js

2

index.js

@@ -15,3 +15,3 @@ /*!

if (!module.exports.version) {
module.exports.version = "2.1.0"
module.exports.version = "2.2.0"
}

@@ -5,2 +5,4 @@ const ut = require('./utils')

const builder = require('xmlbuilder')
const isArray = require('lodash/isArray')
function safeDuration (duration) {

@@ -167,3 +169,9 @@ if (duration < 0 || duration > 28800) {

if (video.tag) {
videoxml.element('video:tag', video.tag)
if (!isArray(video.tag)) {
videoxml.element('video:tag', video.tag)
} else {
for (const tag of video.tag) {
videoxml.element('video:tag', tag)
}
}
}

@@ -170,0 +178,0 @@ if (video.category) {

@@ -299,2 +299,7 @@ /* eslint-disable camelcase, semi, space-before-function-paren, padded-blocks */

conf.urls.forEach(url => {
if (url instanceof Object) {
lastmod = url.lastmod ? url.lastmod : lastmod;
url = url.url;
}
xml.push('<sitemap>');

@@ -301,0 +306,0 @@ xml.push('<loc>' + url + '</loc>');

{
"name": "sitemap",
"version": "2.1.0",
"version": "2.2.0",
"description": "Sitemap-generating framework",

@@ -5,0 +5,0 @@ "License": "MIT",

@@ -28,2 +28,4 @@ sitemap.js

* [Example of Sitemap Index](#example-of-sitemap-index)
* [Example of overriding default xmlns* attributes in urlset element](#example-of-overriding-default-xmlns-attributes-in-urlset-element)
* [Example of news usage](#example-of-news)
* [Testing](#testing)

@@ -305,2 +307,32 @@ * [License](#license)

### Example of overriding default xmlns* attributes in urlset element
Also see 'simple sitemap with dynamic xmlNs' test in [tests/sitemap.js](https://github.com/ekalinin/sitemap.js/blob/master/tests/sitemap.test.js)
```javascript
var sitemap = sm.createSitemapIndex({
xmlns: 'xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"'
});
```
### Example of news
```javascript
const sm = require('sitemap')
const smi = new sm.SitemapItem({
url: 'http://www.example.org/business/article55.html',
news: {
publication: {
name: 'The Example Times',
language: 'en'
},
genres: 'PressRelease, Blog',
publication_date: '2008-12-23',
title: 'Companies A, B in Merger Talks',
keywords: 'business, merger, acquisition, A, B',
stock_tickers: 'NASDAQ:A, NASDAQ:B'
}
})
```
Testing

@@ -307,0 +339,0 @@ -------

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc