Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@antora/site-mapper

Package Overview
Dependencies
Maintainers
2
Versions
81
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@antora/site-mapper - npm Package Compare versions

Comparing version 1.0.0-rc.1 to 1.0.0-rc.2

14

lib/map-site.js
'use strict'
const File = require('vinyl')
const versionCompareDesc = require('@antora/content-classifier/lib/util/version-compare-desc')
const versionCompare = require('@antora/content-classifier/lib/util/version-compare-desc')

@@ -14,4 +14,4 @@ const XML_DECL = '<?xml version="1.0" encoding="UTF-8"?>'

*
* Iterates over the files from the page family in the content catalog and
* creates sitemap files. If there's only one component, all the entries are
* Iterates over the specified pages and creates sitemap files that list the
* URLs for these pages. If there's only one component, all the entries are
* added to a sitemap.xml file that gets published to the root of the site. If

@@ -35,11 +35,9 @@ * there's more than one component, the sitemaps are partitioned into separate

* @param {String} playbook.site.url - The base URL of the site.
* @param {ContentCatalog} contentCatalog - The content catalog that provides
* access to the virtual content files (i.e., pages) in the site.
* @param {Array<File>} pages - The publishable pages to to map.
* @returns {Array<File>} An array of File objects that represent the sitemaps.
*/
function mapSite (playbook, contentCatalog) {
function mapSite (playbook, pages) {
let siteUrl = playbook.site.url
if (!siteUrl) return []
if (siteUrl.charAt(siteUrl.length - 1) === '/') siteUrl = siteUrl.substr(0, siteUrl.length - 1)
const pages = contentCatalog.findBy({ family: 'page' })
if (!pages.length) return []

@@ -66,3 +64,3 @@ const lastmodISO = new Date().toISOString()

sitemapEntries.sort((a, b) => a.url.localeCompare(b.url))
if (sitemap.versions.size > 1) sitemapEntries.sort((a, b) => versionCompareDesc(a.version, b.version))
if (sitemap.versions.size > 1) sitemapEntries.sort((a, b) => versionCompare(a.version, b.version))
delete sitemap.versions

@@ -69,0 +67,0 @@ sitemapEntries = sitemapEntries.map(createUrlElement.bind(null, siteUrl))

{
"name": "@antora/site-mapper",
"version": "1.0.0-rc.1",
"version": "1.0.0-rc.2",
"description": "Generates sitemap files that list all publishable pages in an Antora documentation pipeline.",

@@ -18,3 +18,3 @@ "license": "MPL-2.0",

"dependencies": {
"@antora/content-classifier": "1.0.0-rc.1",
"@antora/content-classifier": "1.0.0-rc.2",
"vinyl": "^2.1.0"

@@ -21,0 +21,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