Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
gatsby-plugin-advanced-sitemap-nonjene-hotfix
Advanced tools
Advanced plugin for generating configurable XML sitemaps with linked media for better SEO and human-readable XSL templates.
The default Gatsby sitemap plugin generates a simple blob of raw XML for all your pages. This advanced sitemap plugin adds more power and configuration, generating a single or multiple sitemaps with full XSL templates to make them neatly organised and human + machine readable, as well linking image resources to encourage media indexing.
Demo: https://gatsby.ghost.org/sitemap.xml
NOTE: This plugin only generates output in production
mode! To test, run: gatsby build && gatsby serve
npm install --save gatsby-plugin-advanced-sitemap
By default this plugin will generate a single sitemap of all pages on your site, without any configuration needed.
// gatsby-config.js
siteMetadata: {
siteUrl: `https://www.example.com`,
},
plugins: [
`gatsby-plugin-advanced-sitemap`
]
If you want to generate advanced, individually organised sitemaps based on your data, you can do so by passing in a query and config. The example below uses Ghost, but this should work with any data source - including Pages, Markdown, Contentful, etc.
Example:
// gatsby-config.js
plugins: [
{
resolve: `gatsby-plugin-advanced-sitemap`,
options: {
// 1 query for each data type
query: `
{
allGhostPost {
edges {
node {
id
slug
updated_at
feature_image
}
}
}
allGhostPage {
edges {
node {
id
slug
updated_at
feature_image
}
}
}
allGhostTag {
edges {
node {
id
slug
feature_image
}
}
}
allGhostAuthor {
edges {
node {
id
slug
profile_image
}
}
}
}`,
// The filepath and name to Index Sitemap. Defaults to '/sitemap.xml'.
output: "/custom-sitemap.xml",
mapping: {
// Each data type can be mapped to a predefined sitemap
// Routes can be grouped in one of: posts, tags, authors, pages, or a custom name
// The default sitemap - if none is passed - will be pages
allGhostPost: {
sitemap: `posts`,
// Add a query level prefix to slugs, Don't get confused with global path prefix from Gatsby
// This will add a prefix to this particular sitemap only
prefix: 'your-prefix/',
// Custom Serializer
serializer: (edges) => {
return edges.map(({ node }) => {
(...) // Custom logic to change final sitemap.
})
}
},
allGhostTag: {
sitemap: `tags`,
},
allGhostAuthor: {
sitemap: `authors`,
},
allGhostPage: {
sitemap: `pages`,
},
},
exclude: [
`/dev-404-page`,
`/404`,
`/404.html`,
`/offline-plugin-app-shell-fallback`,
`/my-excluded-page`,
/(\/)?hash-\S*/, // you can also pass valid RegExp to exclude internal tags for example
],
createLinkInHead: true, // optional: create a link in the `<head>` of your site
addUncaughtPages: true, // optional: will fill up pages that are not caught by queries and mapping and list them under `sitemap-pages.xml`
additionalSitemaps: [ // optional: add additional sitemaps, which are e. g. generated somewhere else, but need to be indexed for this domain
{
name: `my-other-posts`,
url: `/blog/sitemap-posts.xml`,
},
{
url: `https://example.com/sitemap.xml`,
},
],
replacePageUrl(url: URL): URL | string{
// optional: function to manipulate each pages' url.
// the url given is the final url the plugin combines.
// for those who want to simply apply the default serializer but what to manipulate the url.
return url
}
}
}
]
Example output of ☝️ this exact config 👉 https://gatsby.ghost.org/sitemap.xml
yarn install
Build Plugin
yarn build
Run Tests
yarn test
Copyright (c) 2013-2022 Ghost Foundation - Released under the MIT license.
FAQs
Advanced plugin for generating configurable XML sitemaps with linked media for better SEO and human-readable XSL templates.
The npm package gatsby-plugin-advanced-sitemap-nonjene-hotfix receives a total of 0 weekly downloads. As such, gatsby-plugin-advanced-sitemap-nonjene-hotfix popularity was classified as not popular.
We found that gatsby-plugin-advanced-sitemap-nonjene-hotfix demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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 researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.