Skip to content

Other

Static site with separate source branch

This post is dedicated to the use-case where there are 2 different branches in a project. Typically one branch is for the source files, and one is for the generated output files for publishing. This use-case matches the way in which this website is currently hosted, via GitHub pages. Then the master branch is eventually published, whereas other branches remain in the repositories only.

Typically generated websites have a dedicated distribution directory like dist in which the generated files end up. This use-case covers a different use-case where the generated .html files end up next to the .adoc source files.

Setup

Just some prepwork is needed to get this working.

Branches

We have two seperate branches, one for the source files src, and one for the generated output for publishing master. As there is little to no correlation between both branches, the --orphan option can be used during the git checkout to prevent branches from forcefully bing associated with each other.

Git branches

1
2
3
4
5
$ git branch -a
  master
* src
  remotes/origin/master
  remotes/origin/src

Gitignore

Part of the trick is not to ignore the output .html files in the src branch, to make it available for the git commands. The source .adoc files can be ignored from out of the master branch, but that is mainly to reduce the effect of those oops moments.

Doing the transfer dance

To successfully generate the output files and have them end up in the master branch we need to do a little dance. The actual transfer is being done via git stash.

From source to stash

💡 TIP If you are unexperienced with Git, just know you can always run git status to get an overview of the current state of the repository.

Checkout src branch

$ git checkout src

Generate output files

1
2
3
4
$ make html
asciidoctor index.adoc
asciidoctor posts/index.adoc
asciidoctor posts/2016-08-02-static-site-with-separate-source-branch.adoc

Put output files in stash

$ git add *.html **/*.html

From cached to stash

$ git stash

From stash to master

Checkout master branch

$ git checkout master

Remove previous generated files

$ git rm *.html **/*.html

Apply stash

$ git stash pop

The new and modified files are automatically added as staged in git, so making a commit will do.

Commit the new files

$ git commit -m "chore: site update"

If your use-case covers more or different files than the HTML files in this example, then replace the *.html **/*.html globbing patterns with different patterns that match your output files.

Starting a blog in asciidoc

This year I revamped my personal blog. Part of the reason is my involvement in the Asciidoctor project, which drove me to test the limits on this great markup format.

Writing a blog or a static site in asciidoc is no longer an innovative occupation, as this has been done for many years now. In particular the Jekyll static site generator has great support for asciidoc, based on Asciidoctor. Less feature-rich is the Awestruct framework, which is most notably used for generating the Asciidoctor.org website.

In do however believe that both these great Asciidoctor oriented static site generators fail to subscribe to the great toolset that is Asciidoctor. In particular the Asciidoctor diagram and Asciidoctor Extensions projects provide great features for enriching the plain but well-defined base of Asciidoc(tor).

Taking the LaTeX ecosystem as a parallel universe, there is a large difference in the number of integrations available. Although the syntax of Asciidoctor and the Ruby code-base are easier to read and understand compared to TeX based packages, still the number of tools available for LaTeX is vast. A notable benefit of the ecosystem is the way in which all the packages seem to tie into the generic LaTeX rendering layer, resulting in an ecosystem where all packages can be mixed and matched, regardless of the output format. This is unfortunately not so much the case for Asciidoctor, which has several content add-ins and several redering back-ends, but no complete support for all possible combinations.

In order to bring such compatibility, a larger development effort is needed. And I consider this blog revamp my personal motivator in this regard. By refusing to rely on static site generation tools other than a Makefile for easy 'making', all the magic has to come from Asciidoctor itself. I assume this will result in me having to stretch the possibilities of Asciidoctor to the max, and write a number of extensions underway, but that will be for the better.

So expect this blog to be changing more frequently in the coming period, if only for the underlying Asciidoctor tooling.

Dia, I love you

Poem for I Love Free Software Day.

Roses are red. Handles are green.
You’re the finest diagramming software I have ever seen.
Always there to help me out.
And you ask nothing in return.
Creating things together is all I really yearn.

Dia I know we will be a great team.
We can work together even upstream.
So let this be my tag line:
Would you be my Valentine?

Valentine letter in Dia

Valentine letter in Dia

Glasvezelkaravaan

Gedicht over de vele storingen veroorzaakt door de aanleg van glasvezel.

Informatie met de snelheid van het licht, daar komt het aan.
Busje, werklui, zand, stoeptegels, kraan.
Daar komt het aan, daar komt het aan.
Gravend en wackend, de glasvezelkaravaan.

Het is gekomen, de vezel, licht erin.
Volle snelheid, brede band, al bij het begin.
Een wereld vol content, een leven vol zin.
Maar plots geen gas, elektra evenmin.

Daar komt het aan, daar komt het aan.
Telefoon, antenne, gas, water, elektra, allen erachteraan,
Busje, werklui, zand, stoeptegels, kraan, koffie.
De reparateurs, helden in hun kloffie.

Scalability of higher laws

In his book Walden Henry David Thoreau writes about ‘higher laws’. Specific examples he state regard hunting and eating. Even though his statements intuitively seem truthful, the arguments don’t scale very well to modern society. Specifically he shares his view that in order for a personal to mentally ‘grow up’ he’d best practice the less higher practices (like hunting) and learn by experience that this practice isn’t ‘high’ enough. Taking this example, everybody should first make a lot of ‘mistakes’ in order to develop to a better self. However the society is built upon it’s social values and norms and on its technology. People can depart from the learnings of other people, even those who lived decades ago. In society the scientific method for example is regarded as normal and so is taking care of the environment. As for technology, people wouldn’t buy inefficient (although maybe powerful) cars now that fuel-efficient motors are available. The amount of ‘growing up’ for the more basic aspects of life isn’t what it used to be. Considering this growing up still seems possible and desirable, although it’s starting point is the current set of practices of society and technology.

A concrete life purpose

At TEDxMalibu Adam Leipzig gave a talk on defining your life purpose by way of referring to more solid aspects. If you have a sense of your life purpose but aren’t able to make it concrete, just consider clarifying the five aspects that make up your life purpose:

  1. Who are you?
  2. What do you do?
  3. Who do you do it for?
  4. What do those people want or need?
  5. How will they change as a result?

It’s just technology

Of course I also observed the live coverage of the recent Apple-event. But despite the various improvements to their product range and the addition of the watch, it simply wasn’t the magic I was hoping for. That evening it struck me that technology is only about the way of doing things, it’s a tool, it just helps. Melving Kranzberg already knew technology is neither good, nor bad, nor neutral, thereby making it subject to its use. Marketing technology as a life-changer the way Apple does therefore seems to be a bit naive. Sure, insights in your health will help grow awareness, and being given correctional tips will help maintain habits. But bottom line you can only change life by yourself. Without intention, technology will hardly be any good. You might as well achieve the same results without that technology, which might even be better since there wasn’t any technology-dependence. Taking this viewpoint, the world all of a sudden seems to make a lot of buzz about the way we do things. I found the bookbook commercial by Ikea interesting in this regard.