add blog subcommand

Signed-off-by: Ari Archer <ari.web.xyz@gmail.com>
This commit is contained in:
Ari Archer 2023-10-30 12:29:56 +02:00
parent 5497abb44a
commit 0d4c2cfbb1
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG key ID: A50D5B4B599AF8A2
2 changed files with 19 additions and 8 deletions

View file

@ -26,12 +26,10 @@ Or
$ python3 -m pip install --user -r requirements.txt $ python3 -m pip install --user -r requirements.txt
``` ```
## completions ## creating a new blog
- bash
```bash ```bash
$ . completions/blog.bash $ ./scripts/blog.py blog
``` ```
## building ## building
@ -42,18 +40,20 @@ $ . completions/blog.bash
$ CI=1 ./scripts/blog static $ CI=1 ./scripts/blog static
``` ```
- only build blogs - only build posts
```bash ```bash
$ CI=1 ./scripts/blog static $ CI=1 ./scripts/blog build
``` ```
`CI` environment variable is optional, `CI` environment variable is optional,
though setting it in a build/CI environment is good though setting it in a build/CI environment is good
to save time on some operations that are useless to save time on some operations that are useless
in that context, for example sorting blogs. in that context, for example sorting blogs
`CI` can have any value. `CI` can have any value
`NOCLR` also disables colours
## the API ## the API

View file

@ -1469,6 +1469,17 @@ def dev(config: dict[str, typing.Any]) -> int:
return serve(config) return serve(config)
@cmds.new
def blog(config: dict[str, typing.Any]) -> int:
"""generate a new blog"""
log("changing config")
config.update(DEFAULT_CONFIG)
lnew("blog set to default values")
return OK
def main() -> int: def main() -> int:
"""entry / main function""" """entry / main function"""