Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
next-with-sitemap
Advanced tools
Readme
Higher order Next.js config to generate sitemap.xml
and robots.txt
.
Read more at Medium.
Heavily inspired from IlusionDev/nextjs-sitemap-generator.
yarn add next-with-sitemap
Update or create next.config.js
with
const withSitemap = require("next-with-sitemap");
module.exports = withSitemap({
sitemap: {
baseUrl: "https://www.example.com",
},
// .
// ..
// ... other Next.js config
});
Add sitemap.xml
and robots.txt
to your .gitignore
robots.txt
sitemap.xml
There are options you can use to customize the behavior of this plugin
by adding sitemap
object in the Next.js config in next.config.js
.
Alongside those given sitemap
options, this library would also rely
on your Next.js config values exportPathMap
,
exportTrailingSlash
,
and pageExtensions
to come up with the correct sitemap.xml
content.
const withSitemap = require("next-with-sitemap");
module.exports = withSitemap({
sitemap: {
baseUrl: "https://www.example.com",
alternateBaseUrls: [
{
lang: "jp",
url: "https://example.jp",
},
{
lang: "es",
url: "https://example.com/es",
},
],
dest: "public",
excludedPaths: ["/login", "/signup"],
extraPaths: ["/extra/path"],
pages: "pages",
pageTags: [
{
path: "/",
priority: 1.0,
},
{
path: "/extra/path",
changefreq: "monthly",
},
{
path: "/about",
changefreq: "weekly",
priority: 0.5,
},
],
robots: true,
sitemap: true,
},
});
https://www.example.com
).[]
.lang
(required) to the language identifier,url
(required) to the base url that should be used for that lang
.public
.[]
.pages
folder and that should be included to the sitemap.
[]
.pages
.[]
.path
(required) to the relative path of the page,changefreq
to one of always
, hourly
, daily
, weekly
, monthly
, yearly
, never
values,priority
to a number value between 0
and 1
(inclusive).robots.txt
generation.
true
,robots: false
, so it won't generate a robots.txt
,robots: true
to generate a robots.txt
.sitemap.xml
generation.
true
,sitemap: false
, so it won't generate a sitemap.xml
,sitemap: true
to generate a sitemap.xml
.FAQs
Higher order Next.js configuration for generating sitemap.xml and robots.txt
The npm package next-with-sitemap receives a total of 79 weekly downloads. As such, next-with-sitemap popularity was classified as not popular.
We found that next-with-sitemap 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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.