New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

vuepress-plugin-sitemap2

Package Overview
Dependencies
Maintainers
1
Versions
307
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vuepress-plugin-sitemap2 - npm Package Compare versions

Comparing version 2.0.0-alpha.21 to 2.0.0-alpha.22

2

lib/node/index.js

@@ -1,2 +0,2 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@vuepress/utils"),t=require("sitemap");const a=[],s=e=>({defaultPath:e.path.replace(e.pathLocale,"/"),pathLocale:e.pathLocale}),n=async(n,r)=>{const{excludeUrls:i=[],extraUrls:p=[],xmlNameSpace:l}=r,o=r.hostname.replace(/\/$/u,""),c=r.sitemapFilename?r.sitemapFilename.replace(/^\//u,""):"sitemap.xml",{dir:u,options:{base:m}}=n;await e.withSpinner(`Generating sitemap to ${e.chalk.cyan(c)}`)((()=>new Promise((d=>{const h=new t.SitemapStream({hostname:o,xmlns:l}),g=((t,n)=>{const{changefreq:r="daily",excludeUrls:i=["/404.html"],modifyTimeGetter:p=(e=>e.data.git?.updatedTime?new Date(e.data.git.updatedTime).toISOString():"")}=n,{pages:l,options:{base:o,locales:c}}=t,u=l.reduce(((e,t)=>{const{defaultPath:a,pathLocale:n}=s(t),r=e.get(a)||[];return r.push(n),e.set(a,r)}),new Map),m=new Map;return l.forEach((n=>{const l=n.frontmatter.sitemap||{},d=(n.frontmatter.head||[]).find((e=>"robots"===e[1].name));(d?(d[1].content||"").split(/,/u).map((e=>e.trim())).includes("noindex"):l.exclude)&&i.push(n.path);const h=p(n),{defaultPath:g}=s(n),f=u.get(g)||[];let w=[];f.length>1&&(t.env.isDebug&&f.forEach((t=>{c[t].lang||a.includes(t)||(e.logger.warn(`[@vuepress/plugin-sitemap] 'lang' option for ${t} is missing`),a.push(t))})),w=f.map((e=>({lang:c[e].lang||"en",url:`${o.replace(/\/$/,"")}${g.replace(/^\//u,e)}`}))));const $={changefreq:r,links:w,...h?{lastmod:h}:{},...l};t.env.isDebug&&e.logger.info(`[@vuepress/plugin-sitemap] sitemap option for ${n.path}`,$),m.set(n.path,$)})),n.excludeUrls=i,m})(n,r),f=u.dest(c),w=e.fs.createWriteStream(f);h.pipe(w),g.forEach(((e,t)=>{i.includes(t)||h.write({url:`${m}${t.replace(/^\//u,"")}`,...e})})),p.forEach((e=>h.write({url:`${m}${e.replace(/^\//u,"")}`}))),h.end((()=>{d()}))}))));const d=u.dest("robots.txt");e.fs.existsSync(d)&&await e.withSpinner(`Appended sitemap path to ${e.chalk.cyan("robots.txt")}`)((async()=>{const t=`${(await e.fs.readFile(d,{encoding:"utf8"})).replace(/^Sitemap: .*$/u,"")}\nSitemap: ${o}${m}${c}\n`;await e.fs.writeFile(d,t,{flag:"w"})}))},r=(t,a)=>{const s={name:"vuepress-plugin-sitemap2"};return t.hostname?{...s,async onGenerated(){await n(a,t)}}:(e.logger.warn(`[${s.name}] 'hostname' is required`),s)};exports.default=r,exports.sitemap=e=>[r,e],exports.sitemapPlugin=r;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@vuepress/utils"),t=require("sitemap");const a=[],s=e=>({defaultPath:e.path.replace(e.pathLocale,"/"),pathLocale:e.pathLocale}),n=async(n,r)=>{const{excludeUrls:i=[],extraUrls:p=[],xmlNameSpace:l}=r,o=r.hostname.replace(/\/$/u,""),c=r.sitemapFilename?r.sitemapFilename.replace(/^\//u,""):"sitemap.xml",{dir:u,options:{base:m}}=n;await e.withSpinner(`Generating sitemap to ${e.chalk.cyan(c)}`)((()=>new Promise((d=>{const h=new t.SitemapStream({hostname:o,xmlns:l}),g=((t,n)=>{const{changefreq:r="daily",excludeUrls:i=["/404.html"],modifyTimeGetter:p=(e=>e.data.git?.updatedTime?new Date(e.data.git.updatedTime).toISOString():"")}=n,{pages:l,options:{base:o,locales:c}}=t,u=l.reduce(((e,t)=>{const{defaultPath:a,pathLocale:n}=s(t),r=e.get(a)||[];return r.push(n),e.set(a,r)}),new Map),m=new Map;return l.forEach((n=>{const l=n.frontmatter.sitemap||{},d=(n.frontmatter.head||[]).find((e=>"robots"===e[1].name));(d?(d[1].content||"").split(/,/u).map((e=>e.trim())).includes("noindex"):l.exclude)&&i.push(n.path);const h=p(n),{defaultPath:g}=s(n),f=u.get(g)||[];let w=[];f.length>1&&(t.env.isDebug&&f.forEach((t=>{c[t].lang||a.includes(t)||(e.logger.warn(`[@vuepress/plugin-sitemap] 'lang' option for ${t} is missing`),a.push(t))})),w=f.map((e=>({lang:c[e].lang||"en",url:`${o.replace(/\/$/,"")}${g.replace(/^\//u,e)}`}))));const $={changefreq:r,links:w,...h?{lastmod:h}:{},...l};t.env.isDebug&&e.logger.info(`[@vuepress/plugin-sitemap] sitemap option for ${n.path}`,$),m.set(n.path,$)})),n.excludeUrls=i,m})(n,r),f=u.dest(c),w=e.fs.createWriteStream(f);h.pipe(w),g.forEach(((e,t)=>{i.includes(t)||h.write({url:`${m}${t.replace(/^\//u,"")}`,...e})})),p.forEach((e=>h.write({url:`${m}${e.replace(/^\//u,"")}`}))),h.end((()=>{d()}))}))));const d=u.dest("robots.txt");e.fs.existsSync(d)&&await e.withSpinner(`Appended sitemap path to ${e.chalk.cyan("robots.txt")}`)((async()=>{const t=`${(await e.fs.readFile(d,{encoding:"utf8"})).replace(/^Sitemap: .*$/u,"")}\nSitemap: ${o}${m}${c}\n`;await e.fs.writeFile(d,t,{flag:"w"})}))},r=(t,a)=>{const s={name:"vuepress-plugin-sitemap2"};return t.hostname?{...s,async onGenerated(){await n(a,t)}}:(e.logger.warn(`[${s.name}] 'hostname' is required`),s)};exports.default=r,exports.sitemap=e=>["sitemap2",e],exports.sitemapPlugin=r;
//# sourceMappingURL=index.js.map
{
"name": "vuepress-plugin-sitemap2",
"version": "2.0.0-alpha.21",
"version": "2.0.0-alpha.22",
"description": "Sitemap plugin for vuepress",

@@ -43,3 +43,3 @@ "keywords": [

"dependencies": {
"@mr-hope/vuepress-shared": "2.0.0-alpha.21",
"@mr-hope/vuepress-shared": "2.0.0-alpha.22",
"@vuepress/core": "2.0.0-beta.35",

@@ -52,3 +52,3 @@ "@vuepress/utils": "2.0.0-beta.35",

},
"gitHead": "4ff016b1cf7bed5c2cc0a755c36687c53197a7a2"
"gitHead": "02926821ef30b0e8210564e961c0a14d3497c872"
}

@@ -29,2 +29,2 @@ import { logger } from "@vuepress/utils";

options: SitemapOptions | false
): PluginConfig<SitemapOptions> => [sitemapPlugin, options];
): PluginConfig<SitemapOptions> => ["sitemap2", options];

Sorry, the diff of this file is not supported yet

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