Skip to content

Commit

Permalink
Merge pull request #7 from freshcodes/master
Browse files Browse the repository at this point in the history
Correct documentation for `--changefreq` shorthand
  • Loading branch information
zerodevx authored Feb 22, 2020
2 parents b0d6581 + eae5b1f commit c77b23a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ so that you can pipe it to do other cool stuff. CLI also allows you to pipe in B
| -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) |
| -c | --changefreq | glob-changefreq pair (eg: foo/*.html=daily) |
| -n | --no-clean | disable clean URLs |
| -l | --slash | add trailing slash to all URLs |
| -t | --text | output as .TXT instead |
Expand Down Expand Up @@ -96,7 +96,7 @@ The `-p` and `-c` flags allow multiple entries and accept `glob-*` pairs as inpu

Latter entries will override the former. So for example in

`sscli https://example.com -f '**/*=weekly' -f 'events/**=daily'`
`sscli https://example.com -c '**/*=weekly' -c 'events/**=daily'`

all URL entries will contain `<changefreq>weekly</changefreq>` while pages that match `event/**` will contain
`<changefreq>daily</changefreq>`.
Expand Down Expand Up @@ -135,7 +135,7 @@ so every pages' default is 0.5. To change the *relative* priority of certain pag

#### Set changefreq of all pages to weekly, and some to daily

`sscli https://example.com -f '**/*=weekly' -f 'events/**=daily' > sm.xml`
`sscli https://example.com -c '**/*=weekly' -c 'events/**=daily' > sm.xml`


#### Pipe in the base URL
Expand Down
7 changes: 7 additions & 0 deletions test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ describe('#index', () => {
expect(ctx.stdout).to.contain('<changefreq>weekly</changefreq>');
});

test
.stdout()
.do(() => cmd.run(['https://example.com', '--root', 'test/test-site', '-c', 'about/index.html=daily']))
.it('changefreq', ctx => {
expect(ctx.stdout).to.contain('<changefreq>daily</changefreq>');
});

test
.stdout()
.do(() => cmd.run(['https://example.com', '--root', 'test/test-site']))
Expand Down

0 comments on commit c77b23a

Please sign in to comment.