Restart my personal braindump archive

2024-04-14

As the demands of my personal circumstances have undergone successive transformations, I have temporarily ceased contributing to my personal blog. However, I have recently come to the realization that there are certain ideas and experiences that I wish to document for my own benefit, as well as potentially for the edification of others. It is with this conviction that I am now initiating the process of revitalizing my digital sanctuary.

Restart with easy-hugo

In order to revitalize my blog, I recognized the necessity of optimizing my workflow. During my search, I came across a tool called easy-hugo which facilitates the process of exploring, composing, and publishing content in a more streamlined manner when utilized within the Emacs text editor environment.

Configuration

The configuration is fairly simple:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
  (use-package easy-hugo
    :init
    (setq easy-hugo-basedir "~/repos/private/rtzptz.xyz/"
          easy-hugo-postdir "content/posts"
          easy-hugo-default-ext ".org"
          easy-hugo-org-header t
          easy-hugo-url "https://rtzptz.xyz"
          easy-hugo-sshdomain "<ssh-config-entry>"
          easy-hugo-root "<path-to-root>"
          easy-hugo-previewtime "300"
          easy-hugo-server-flags "-D")
    :config (easy-hugo-enable-menu)
    :general (:keymaps 'jj-open-keymap
                       :wk-match-keys nil
                       "b" '(easy-hugo :wk "blog")
                       "m" '(easy-hugo-menu :wk "blog menu")))

The main points are:

  • easy-hugo-basedir - Points to the local directory or the website
  • easy-hugo-postdir - Points the the sub-folder containing the blog posts
  • easy-hugo-url - Contains the URL of the website
  • easy-hugo-sshdomain - Contains the name as defined in the ssh configuration for accessing the remote server
  • easy-hugo-root - Points to the directory of the remote server

easy-hugo provides two basic commands to interact with your blogging environment. Either through easy-hugo which provides an overview of your blog posts and the possible actions as transient menu. The other option is easy-hugo-menu which only opens the transient menu but with limited options.

After configuration, the action P from the easy-hugo-menu allows to publish your site or p to preview it. On thing to notice is that the local hugo server is killed after easy-hugo-previewtime.

Org

Another good change is that Hugo now allows .org files to be used directly taking away the burden of generating Markdown as intermediate format. Thus, I changed the default new post to org files and enabled the org header provided by easy-hugo.

Ficurinia theme

Another point is choosing the correct theme.

I think the most important parts are the support for individual site (which not blog posts) and drafts. A good add-on is support for you own layout and CSS extensions, as well as support for an analytic software. I choose hugo-ficurinia which has a nice layout and extensive support for various features.

Maybe, I change some visual things later on.

umami

For some basic analytic stuff the theme supports either plausible or umami. Both I didn't know before. After some investigation, I found that only umami is a possibility since I use a shared hoster for serving my site. Following the instructions of my hoster was fairly simple and the inclusion works like a charm. Since umami uses anonymous tracking no consent banner or pop-up is needed.

Missing parts

Since I wrote this blog post with my new setup I stumbled across some obstacles which irritated me.

  1. The publishing is done without acknowledge. This can lead to unexpected publishing while one only wants to preview its own site.
  2. The hugo front-matter cannot customized for org files.
  3. If the template uses special properties in the front-matter it's hard to get them right in org mode.
  4. While easy-hugo provides an overview about the blog posts which a buffer in view-mode, I'm missing a more complete overview with access to the static sites or the custom layout. Partly this can be done with switching the blog directory in easy-hugo with , and . but isn't to my liking. Thus, I use treemacs to get a better overview.

Scope

My prior posts had the scope to explain a certain technical topic in-depth or broad enough that the topic is mostly covered. This lead to long write times and many reviews. I think that wasn't a good workflow as the intention is another one. My original intention was to keep notes for myself and for a broader audience only as the second step. Another intention was to practice my writing skills and I tried to get it perfect from the beginning. This is a real flaw and prevents me from releasing more frequently.

Thus, I need a better scope for my blog posts.

  1. Faster and shorter posts
  2. Emacs and tech related stuff should be shorter
  3. Only a few longer posts for rare stuff
  4. Some posts about management and team leading
  5. I want to try out language model which integrate with Emacs

I think I start slow with my new scope and see what's coming around.

Changes to my writing setup

Changing the base packages I used to write and publish stuff goes along with reading other people setups. I took some ideas along the road and try to integrate them into my own workflow.

Here are the changes to my workflow and configuration.

Auto-fill mode

I never seen this as a big deal despite being someone which limits himself to a line length between 110 and 120 characters in all writing and coding stuff.

Following the writers guidelines, I added the mode to my text-mode-hook.

1
2
3
4
5
  (add-hook
   'text-mode-hook
   'auto-fill-mode)

  (setq-default fill-column 90)

This change frees my head from thinking about line-breaks anymore and limits the line length to 90 columns.

Free space around closed headlines

Another constant issues is solved by another nice piece of Emacs lisp.

1
2
3
4
  (customize-set-variable 'org-blank-before-new-entry
                          '((heading . nil)
                            (plain-list-item . nil)))
  (setq org-cycle-separator-lines 1)

In this instance, the content has been sourced from here and includes the addition of a single blank line following each headline that is enclosed. This formatting enhancement provides a more visually appealing presentation of the individual headings, alleviating the strain on the eyes that can result from closely spaced text.

AI integration

https://github.com/karthink/gptel

with custom backend an llamafile https://github.com/Mozilla-Ocho/llamafile

1
2
3
4
5
6
7
8
9
  (use-package gptel
    :config
    (setq-default
     gptel-model   "tinyllama"
     gptel-backend (gptel-make-openai "llama-cpp"
                     :stream t
                     :protocol "http"
                     :host "localhost:8080"
                     :models '("tinyllama"))))
  • to run llama files use sh -c llamafile as zsh causes problems
  • opens on port 8080 a chatgpt like api
  • alternative https://github.com/s-kostyaev/ellama but to many options, gptel more free foram which allows to play freely around

Parts of this posts are rewritting with zephir-beta llm.