
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
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. CLI also allows you to pipe in BASEURL via stdin
.
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: current dir] root directory to start from |
-m | --match | [default: **/*.html,!404.html] list of globs to match |
-p | --priority | glob-priority pair (eg: foo/*.html=0.1) |
-f | --changefreq | glob-changefreq pair (eg: foo/*.html=daily) |
-n | --no-clean | disable clean URLs |
-s | --slash | add trailing slash to all URLs |
-t | --text | output as .TXT instead |
-v | --verbose | be more verbose |
Whether or not to include the .html
extension. By default, something like:
rootDir/foo/index.html
becomes https://example.com/foo
.
rootDir/foo/bar/foobar.html
becomes https://example.com/foo/bar/foobar
.
Pass -n
option to disable this behavior.
Controls whether or not URLs should include trailing slashes. For example:
rootDir/bar/index.html
becomes https://example.com/bar/
.
For obvious reasons, this cannot be used together with -n
.
The -m
flag allows multiple entries to be input. By default it's set to the following globs: **/*.html
and !404.html
.
You can change the glob pattern matches to suit your use-case, like:
sscli https://example.com -m '**/*.html' -m '!404.html' -m '!**/ignore/**' -m '!this/other/specific/file.html'
The -p
and -c
flags allow multiple entries and accept glob-*
pairs as input. A glob-*
pair is input as
<glob-pattern>=<value>
, where =
is used as the separator. For example, a glob-frequency pair should be input as
events/**/*.html=daily
.
Latter entries will override the former. So for example in
sscli https://example.com -f '**/*=weekly' -f 'events/**=daily'
all URL entries will contain <changefreq>weekly</changefreq>
while pages that match event/**
will contain
<changefreq>daily</changefreq>
.
Sitemaps can be formatted as a simple text file as well,
where each line contains exactly one URL. Pass the option -t
to do so. In this case, --priority
and --changefreq
are redundant and ignored.
dist
folderstatic-sitemap-cli https://example.com -r dist > dist/sitemap.xml
OR
sscli https://example.com -r dist > dist/sitemap.xml
sscli https://example.com -m '**/*.html' '!404.html' '!**/ignore/**' '!this/other/specific/file.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 of certain pages:
sscli https://example.com -p '**/{foo,bar}/**=0.1' '**/important/**=0.9' > sm.xml
sscli https://example.com -f '**/*=weekly' -f 'events/**=daily' > sm.xml
echo https://example.com | sscli > sm.xml
Add tests! :sweat_smile:
Run npm run test
.
v1.0.1 - 2019-08-16:
v1.0.0 - 2019-08-15:
--ignore
is deprecated. Use --match
instead.=
instead.v0.2.0 - 2019-07-31:
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 122 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
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.