Skip to content

Commit

Permalink
New feature: Granular rebuilds
Browse files Browse the repository at this point in the history
The `rebuild` command is now much more powerful. You
can still these things:

```
rebuild file.mdsh > file.html
rebuild file.md   > file.html
```

...and so on.. But now you can do much more "granular"
rebuilds, where only specific pages are rebuilt.

Here are the new commands:

```
rebuild homepage            # rebuild index.html (the homepage)

rebuild archive             # rebuild archive.html

rebuild 404                 # rebuild 404.html

rebuild search              # rebuild search.html

rebuild authors             # rebuild all pages in authors/

rebuild authors:foo,bar     # rebuild pages authors/foo.html and tags/bar.html

rebuild categories          # rebuild all pages in categories/

rebuild categories:foo,bar  # rebuild pages categories/foo.html and tags/bar.html

rebuild tags                # rebuild all pages in tags/

rebuild tags:foo,bar        # rebuild pages tags/foo.html and tags/bar.html

rebuild years               # rebuild all posts/<years>/index.html index pages

rebuild years:foo           # rebuild posts/foo/index.html specifically

rebuild months 2019         # rebuild all monthly index pages in posts/2019/

rebuild months:foo 2019     # rebuild posts/2019/foo/index.html specifically
```

You can also combine them like so:

```
rebuild authors:bob tags:foo,bar 404
```
  • Loading branch information
sc0ttj committed Sep 13, 2019
1 parent 7032493 commit f990e75
Show file tree
Hide file tree
Showing 2 changed files with 321 additions and 169 deletions.
8 changes: 2 additions & 6 deletions .app/cli-interface.bash
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@ function rebuild {
${PWD}/.app/create_page.sh $1 $2
return 0
fi
if [ "$1" = "homepage" ];then
post_title="Homepage" ${PWD}/.app/create_page.sh > index.html
return 0
fi
if [ "$1" = "rss" ];then
.app/create_rss.sh posts/ > feed.rss
return 0
Expand All @@ -65,8 +61,8 @@ function rebuild {
${PWD}/.app/generate_sitemap.sh
return 0
fi
# $1 might be a parameter, like -all
${PWD}/.app/update_pages.sh $1
# $1 might be a parameter, like 'tags', 'year:2019', 'authors:foo,bar', '-all', ...
${PWD}/.app/update_pages.sh $@
}

function help {
Expand Down
Loading

0 comments on commit f990e75

Please sign in to comment.