Mario Campos

Musings, with a hint of code.

Using Org-Mode with Hugo and Brutalist-Minimalist Style

This text shows how to use org-mode files as input format for web pages and blog posts.

Nullam eu ante

Vel est convallis dignissim. Fusce suscipit, wisi nec facilisis facilisis, est dui fermentum leo, quis tempor ligula erat quis odio. Nunc porta vulputate tellus. $\psi^2 = \alpha_0$. Nunc rutrum turpis sed pede. Sed bibendum.

Aliquam posuere. Nunc aliquet, augue nec adipiscing interdum, lacus tellus malesuada massa, quis varius mi purus non odio. Pellentesque condimentum, magna ut suscipit hendrerit, ipsum augue ornare nulla, non luctus diam neque sit amet urna. Curabitur vulputate vestibulum lorem. Fusce sagittis, libero non molestie mollis, magna orci ultrices dolor, at vulputate neque nulla lacinia eros. Sed id ligula quis est convallis tempor. Curabitur lacinia pulvinar nibh. Nam a sapien.

Aliquam erat volutpat

Nunc eleifend leo vitae magna. In id erat non orci commodo lobortis. Proin neque massa, cursus ut, gravida ut, lobortis eget, lacus. Sed diam.

Praesent fermentum tempor tellus. Nullam tempus. Mauris ac felis vel velit tristique imperdiet. Donec at pede. Etiam vel neque nec dui dignissim bibendum. Vivamus id enim. Phasellus neque orci, porta a, aliquet quis, semper a, massa. Phasellus purus. Pellentesque tristique imperdiet tortor. Nam euismod tellus id erat.

  #include <stdio.h>

  int main(int argc, argv char**)
  {
    printf("%s\n", "hello world");
  }

The parameters to the source block don't have the expected effect, but the following works:

199
200
201
202
203
204
#include <stdio.h>

int main(int argc, argv char**)
{
	printf("%s\n", "hello world");
}

So, we'd need some kind of preprocessing here. Anyway.

A second problem is that the default indent of the source (seen in the first source block) shows up in the rendered code. We need to unindent the source, preferably again by a suitable pre-processing. Doing it manually would be undone by emacs on every edit. This is how properly indented source (i.e. w/o the extra leading spaces) would look like:

#include <stdio.h>

int main(int argc, argv char**)
{
  printf("%s\n", "hello world");
}

Another point in case for preprocessing would be that we'd then actually have the chance to properly indent the headings (so that we can work with levels 1 instead of having to start with 2), being able to pick up the tile from the first level 1 heading etc, picking up meta data from a property block or the file bottom (which interacts better with roam and deft), adding bibliography and standard links at the bottom or rewriting links.

Source: https://mario-campos.github.io/documentation/some/, 2022-02-27