mirror of
https://git.ari.lt/ari.lt/blog.ari.lt.git
synced 2025-02-04 17:49:24 +01:00
add blog
subcommand
Signed-off-by: Ari Archer <ari.web.xyz@gmail.com>
This commit is contained in:
parent
5497abb44a
commit
0d4c2cfbb1
2 changed files with 19 additions and 8 deletions
16
README.md
16
README.md
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -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"""
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue