Skip to content

Commit

Permalink
Merge pull request #1 from zerodevx/feature/allow-stdin
Browse files Browse the repository at this point in the history
Allows `stdin`
  • Loading branch information
zerodevx authored Jul 30, 2019
2 parents 1b33795 + 1dbb2b9 commit ac3fae4
Show file tree
Hide file tree
Showing 4 changed files with 264 additions and 848 deletions.
28 changes: 18 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,14 @@ 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:
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.

so that you can pipe it to do other cool stuff. CLI also allows you to pipe in BASEURL via `stdin`.


### Arguments
Expand All @@ -49,9 +48,9 @@ so that you can pipe it to do other cool stuff.
|--------|--------------|-----------------------------------------------------------------|
| -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 |
| -r | --root | [default: current dir] root directory to start from |
| -m | --match | [default: **/*.html] list of globs to match |
| -i | --ignore | [default: 404.html] 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 |
Expand Down Expand Up @@ -93,7 +92,7 @@ Note: Just put `dist/` for that location, not `dist/.` or `./dist/**`.
#### Ignore a bunch of files

```
sscli https://example.com -i 404.html,foo/*.html > sm.xml
sscli https://example.com -i=404.html foo/**/* > sm.xml
```

#### Set priority of certain pages
Expand All @@ -102,7 +101,13 @@ By default, the optional `<priority>` label ([protocol reference](https://www.si
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
sscli https://example.com -p=**/{foo,bar}/**,0.1 **/important/**,0.9 > sm.xml
```

#### Pipe in the base URL

```
echo https://example.com | sscli > sm.xml
```


Expand All @@ -113,12 +118,15 @@ Add tests! :sweat_smile:

## Changelog

**v0.2.0 - 2019-07-31:**
* Allow BASEURL to be piped in also.
* Refactor some dependencies.

**v0.1.1 - 2019-07-27:**
* Bugfix: properly check rootDir before replacing.
* Add new alias `sscli` because the original is quite a mouthful.

**v0.1.0 - 2019-07-26:**
* Initial release.


* Built in 10 minutes. :stuck_out_tongue_winking_eye:

Loading

0 comments on commit ac3fae4

Please sign in to comment.