Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@recursyve/scully-sitemap
Advanced tools
A Scully routeDiscoveryDone plugin for generating xml sitemaps.
This routeDiscoveryDone
plugin for Scully that will generate one or more sitemaps for your generated routes.
To install this library with npm
run
$ npm install @recursyve/scully-sitemap --save-dev
The following peer dependencies are must be installed separately. Most are installed when install Angular or Scully. You'll likely only need to worry about fast-xml-parser
and xmlbuilder
.
"peerDependencies": {
"@scullyio/scully": "^2.1.14",
"fast-xml-parser": "^4.0.3",
"path-to-regexp": "^6.2.0",
"xmlbuilder": "^15.1.1"
},
Within your Scully config (typescript), get and configure the plugin like so:
import { ScullyConfig, setPluginConfig } from '@scullyio/scully';
import { getSitemapPlugin } from '@gammastream/scully-sitemap';
const SitemapPlugin = getSitemapPlugin();
setPluginConfig(SitemapPlugin, {
urlPrefix: 'https://gamma.stream',
sitemapFilename: 'sitemap.xml',
merge: false,
trailingSlash: false,
changeFreq: 'monthly',
priority: ['1.0', '0.9', '0.8', '0.7', '0.6', '0.5', '0.4', '0.3', '0.2', '0.1', '0.0'],
ignoredRoutes: ['/404'],
routes: {
'/products/:productId': {
changeFreq: 'daily',
priority: '0.9',
sitemapFilename: 'sitemap-products.xml',
merge: true
},
}
});
export const config: ScullyConfig = {
projectRoot: './src',
projectName: 'scully-plugins',
outDir: './dist/static',
routes: {
'/products/:productId': {
type: 'json',
productId: {
url: 'http://localhost:4200/assets/products.json',
property: 'id',
}
}
}
};
Build app and run scully like normal.
npm run build
npm run scully
The priority of a route can be configured by setting the priority level based on the number of segments in a given route.
[
'1.0', // `/` - [ '' ] (1 segment)
'0.9', // `/services` - [ '', 'services' ] (2 segments)
'0.8', // `/services/hosting` - [ '', 'services', 'hosting' ]
// etc...
]
Setting the merge
flag to true causes the generated routes to be merged into the existing sitemap file (if there is one). This allows users to generate a subset of routes without overwriting previously generated routes within the sitemap.
// excerpt
routes: {
'/products/:productId': {
changeFreq: 'daily',
priority: '0.9',
sitemapFilename: 'sitemap-products.xml',
merge: true
},
}
Setting the trailingSlash
flag to true causes the url to be suffixed with a /
. This is useful for SEO. You can set it for the main config or for individual routes.
const SitemapPlugin = getSitemapPlugin();
setPluginConfig(SitemapPlugin, {
urlPrefix: 'https://your.site',
sitemapFilename: 'sitemap.xml',
merge: false,
trailingSlash: true,
});
FAQs
A Scully routeDiscoveryDone plugin for generating xml sitemaps.
The npm package @recursyve/scully-sitemap receives a total of 106 weekly downloads. As such, @recursyve/scully-sitemap popularity was classified as not popular.
We found that @recursyve/scully-sitemap demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.