Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
static-sitemap-cli
Advanced tools
Simple CLI to pre-generate XML sitemaps for static sites locally.
Built in 10 minutes. :stuck_out_tongue_winking_eye:
npm i -g static-sitemap-cli
Syntax: static-sitemap-cli <BASEURL> <options>
At its simplest, just go to your dist
folder and run:
static-sitemap-cli https://example.com > sitemap.xml
OR, because it's quite a mouthful:
sscli https://example.com > sitemap.xml
Where sscli
is just an alias of static-sitemap-cli
. CLI by default outputs to stdout
-
so that you can pipe it to do other cool stuff.
Argument | Description |
---|---|
BASEURL | Base URL that is prefixed to all location entries. For example: https://example.com/ |
Option | Long | Description |
---|---|---|
-h | --help | show CLI help |
-v | --version | show CLI version |
-r | --root | [default: ./] root dir to start from |
-m | --match | [default: .html] comma-separated list of extensions to match |
-i | --ignore | [default: 404.html] comma-separated list of globs to ignore |
-p | --priority | comma-separated glob/priority pair; eg: foo/*.html,0.1 |
-f | --changefreq | comma-separated glob/changefreq pair; eg: foo/*.html,daily |
-n | --no-clean | disable clean URLs |
-s | --slash | add trailing slash to all URLs |
Whether or not to include the .html
extension. By default, something like:
https://example.com/foo/index.html
becomes https://example.com/foo
.
Pass -n
option to disable this behavior.
Control whether or not URLs should include trailing slashes. For example:
https://example.com/bar/index.html
becomes https://example.com/bar/
.
For obvious reasons, this cannot be used together with -n
.
dist/
folderstatic-sitemap-cli https://example.com -r dist/ > dist/sitemap.xml
OR
sscli https://example.com -r dist/ > dist/sitemap.xml
Note: Just put dist/
for that location, not dist/.
or ./dist/**
.
sscli https://example.com -i 404.html,foo/*.html > sm.xml
By default, the optional <priority>
label (protocol reference) is excluded,
so every pages' default is 0.5. To change the relative priority (to 0.1) of certain pages:
sscli https://example.com -p **/privacy-policy/**,0.1 **/terms-of-service/**,0.1 > sm.xml
Add tests! :sweat_smile:
v0.1.1 - 2019-07-27:
sscli
because the original is quite a mouthful.v0.1.0 - 2019-07-26:
FAQs
CLI to generate XML sitemaps for static sites from local filesystem
The npm package static-sitemap-cli receives a total of 206 weekly downloads. As such, static-sitemap-cli popularity was classified as not popular.
We found that static-sitemap-cli demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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.
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.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.