2025-01-11 23:51:24 +02:00
# [blog.ari.lt](https://blog.ari.lt/)
2022-03-11 13:35:37 +02:00
2025-01-11 23:51:24 +02:00
> The Ari-web blog.
2022-03-11 13:35:37 +02:00
2025-01-11 23:51:24 +02:00
## Installing dependencies
2022-03-11 13:46:45 +02:00
2025-01-11 23:51:24 +02:00
The blog generator has two dependency files - `requirements.txt` and `requirements-extra.txt` . The normal requirements file must *always* be installed such as:
2022-03-11 13:35:37 +02:00
2025-01-11 23:51:24 +02:00
pip install -r requirements.txt
2022-04-02 20:43:37 +03:00
2025-01-11 23:51:24 +02:00
And the `-extra` requirements file only needs to be installed when you are using commands such as `new` to write blog posts. The normal requirements file is tailored to provide a minimal dependency tree for CI/CD servers.
2022-04-02 20:43:37 +03:00
2025-01-11 23:51:24 +02:00
## Creating a new blog
2022-04-07 22:32:55 +03:00
2025-01-11 23:51:24 +02:00
To create a new blog (not blog post) run
2023-10-30 12:40:56 +02:00
2025-01-11 23:51:24 +02:00
./scripts/blog.py blog
2022-04-07 22:32:55 +03:00
2025-01-11 23:51:24 +02:00
This will generate a new empty `blog.json` which you can edit and adjust to your needs
2022-04-07 22:32:55 +03:00
2025-01-11 23:51:24 +02:00
### Writing a new blog post
2022-04-07 22:32:55 +03:00
2025-01-11 23:51:24 +02:00
After you've set up `blog.json` you can proceed to write a new blog post using the `new` subcommand:
2022-04-07 22:32:55 +03:00
2025-01-11 23:51:24 +02:00
./scripts/blog.py new
2022-04-07 22:32:55 +03:00
2025-01-11 23:51:24 +02:00
This will allow you to write blog posts in markdown as well as ask you for metadata.
2022-04-07 22:32:55 +03:00
2025-01-11 23:51:24 +02:00
## Building
2022-04-07 22:32:55 +03:00
2025-01-11 23:51:24 +02:00
- A full-on static website (recommended): `CI=1 ./scripts/blog static`
- Only blog posts: `CI=1 ./scripts/blog build`
2023-10-30 12:29:56 +02:00
2025-01-11 23:51:24 +02:00
The `CI` environment variable is optional, although setting it in a build/CI environment is good to save time on some operations that are useless in that context, for example sorting blog posts or massive logging.
2022-04-07 22:32:55 +03:00
2025-01-11 23:51:24 +02:00
Furthermore, if you want to disable colour support you can also set `NOCLR=1` and it will print things in plain text over a coloured output.
2022-06-01 16:19:08 +03:00
2025-01-11 23:51:24 +02:00
## The API
2022-06-01 16:19:08 +03:00
2025-01-11 23:51:24 +02:00
`recents.json` , `blog.json` , and `media/media.json` are all APIs you can use. For caching purposes SHA256 digests of these static APIs are generated on build at `recents_json_hash.txt` , `blog_json_hash.txt` , and `media/media_json_hash.txt` which you can use to optimise your API usage.
2023-10-06 20:28:31 +03:00
2025-01-11 23:51:24 +02:00
## Help
2023-10-31 21:56:36 +02:00
2025-01-11 23:51:24 +02:00
help -- print help
sort -- sort blog posts by creation time
new -- create a new blog post
ls -- list all posts
ed -- edit posts
med -- minor edit posts
rm -- remove posts
build -- build blog posts
css -- build and minify css
robots -- generate a robots.txt
manifest -- generate a manifest.json
sitemap -- generate a sitemap.xml
rss -- generate an rss feed
apis -- generate and hash apis
clean -- clean up the site
static -- generate a full static site
serve -- simple server
dev -- generate a full static site + serve it
blog -- generate a new blog
search -- search for a term
media -- add media
lsmedia -- list media
rmmedia -- remove media
purgemedia -- purge unused or unindexed media
infomedia -- get info about media
2023-10-31 21:56:36 +02:00
2025-01-11 23:51:24 +02:00
Custom markdown extensions (besides the well-known ones):
2023-10-06 20:28:31 +03:00
2025-01-11 23:51:24 +02:00
* Titlelink: < #:Your Header Title > - links to a header
* Media embed: < @:e3b0c4429 ... > - embeds media