home73k/README.md

27 lines
1.3 KiB
Markdown
Raw Normal View History

2021-03-28 21:12:55 -04:00
# Home73k
Personal website with blog.
2021-03-28 21:12:55 -04:00
## Blog posts
2021-03-28 21:12:55 -04:00
Posts are markdown files stored under `priv/content` and parsed by [Earmark](https://hexdocs.pm/earmark/Earmark.html). This can be configured in `config.exs` under `config :home73k, :app_global_vars, blog_content: "path/to/content"`
2021-03-28 21:12:55 -04:00
### Syntax highlighting
2021-03-28 21:12:55 -04:00
For the challenge of it, and to keep user's browsers from having to run javascript just to highlight some code, I chose to do server-side syntax highlighting.
2021-03-28 21:12:55 -04:00
Due to the lexer limitations of elixir-native solutions, the highlighter uses [Pygments](https://pygments.org/) by calling [pygmentize](https://pygments.org/docs/cmdline/) via [System.cmd](https://hexdocs.pm/elixir/System.html#cmd/3)
However, this requires installing python3 & Pygments. Best way to do this is with a venv (virtual python environment), so you'll also want `python3-venv` installed on a debian system, for example.
By default, Home73k is configured to look for pygmentize in a venv at `priv/pygments/bin/pygmentize` -- here's a quick howto for how to set that up:
```shell
cd priv
python3 -m venv pygments
source pygments/bin/activate
pip3 install Pygments
```
The location of bin/pygmentize can be configured in `config.exs` under `config :home73k, :app_global_vars, pygmentize_bin: "path/to/bin/pygmentize"`