/blog

Personal blog using org-mode, hugo and Cloudflare Pages. Home of https://gjhenrique.com

Primary LanguageCSS

(blog 'zezin)

Home of gjhenrique.com

From org-mode to HTML

It uses the built-in publishing management system from org-mode. org-publish-project-alist defines where org-mode should look into to convert org and resource files and the respective folders.

Calling (org-publish-all) converts the posts from org to HTML and moves the resources, like images and custom JS. This project includes a .dir-locals.el file for local development that sets this variable automatically.

Hugo

This blog uses hugo based on listed theme to generate the static site. It's blazing fast.

CI

The steps using Github Actions are as follows:

  1. Export the posts from an emacs container containing org-mode, htmlize and packages defining the code coloring
  2. Calls hugo to create the static site
  3. Publish the files to Cloudflare Pages With the wrangler tool. main branch deploys to production env automatically, and all other branches to preview. Cloudflare Access restricts access to the preview environment.

Syntax coloring

Creating the CSS file to code snippets follows the process:

  1. Export the theme file. Use emacs -q -l /app/export.el -f zezin-generate-themefile to get the file with the CSS rules. htmlize creates the doom-one theme CSS file by default.
  2. Trim only the posts' CSS rules with purgecss. Call the script node syntax-extractor
  3. Override the ones you don't like via _custom.scss
  4. These CSS rules will style the generated #+BEGIN_SRC org sections.

It works with any Emacs theme exportable via htmlize.

Posts