Personal website with markdown blog & syntax highlighting
Find a file
2021-04-05 23:08:02 -04:00
assets added remainder of content 2021-04-05 22:42:52 -04:00
config remove prod.secret.exs from git tracking 2021-04-05 23:08:02 -04:00
lib fixes 2021-04-05 22:48:30 -04:00
priv fixes 2021-04-05 22:48:30 -04:00
test added content, post display 2021-04-03 23:22:35 -04:00
.formatter.exs initial commit 2021-03-28 21:12:55 -04:00
.gitignore syntax highlighting and blog/post liveviews working; numerous other styling updates 2021-04-05 16:51:59 -04:00
.iex.exs syntax highlighting and blog/post liveviews working; numerous other styling updates 2021-04-05 16:51:59 -04:00
mix.exs added content, post display 2021-04-03 23:22:35 -04:00
mix.lock syntax highlighting and blog/post liveviews working; numerous other styling updates 2021-04-05 16:51:59 -04:00
README.md syntax highlighting and blog/post liveviews working; numerous other styling updates 2021-04-05 16:51:59 -04:00

Home73k

Personal website with blog.

Blog posts

Posts are markdown files stored under priv/content and parsed by Earmark. This can be configured in config.exs under config :home73k, :app_global_vars, blog_content: "path/to/content"

Syntax highlighting

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.

Due to the lexer limitations of elixir-native solutions, the highlighter uses Pygments by calling pygmentize via System.cmd

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:

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"