Another new theme

My current theme, NewPapyrus, looks rather like a page printed on paper; i.e., like this:

A screenshot of the NewPapyrus theme

When I first saw a site that looked like this, I quite liked it. However, whilst it does the job, it isn't elegant. It's functional, but I have come to think that, aesthetically, it is lacking. After all, what is the point in replicating paper on a screen?

Looking at typographic sites such as The Ministry of Type, I am inspired to do something different to what I have (and maybe more like them).

Full entry …

Organizing orgmode

I did a half-hearted port from Markdown to Orgmode for the underlying text of this site. And I also did a half-hearted port to using Hugo page bundles (in anticipating of getting webmentions working).

But the time has come for me to fix things up properly.

First of all, I need to covert my text files from being formated using markdown to be using Orgmode. Enter pandoc.

But that mucks up my frontmatter (that's really important to Hugo). So, enter sed.

The two scripts that do the heavy lifting, are a shell script

for INFILE in $(grep -L "^#+date" */*.org)
 echo "Covertingt from Markdown: " $INFILE
 export OUTFILE=$INFILE.txt
 pandoc -f markdown -t org -o $OUTFILE $INFILE

 echo "Fixing frontmatter in: " $OUTFILE
 sed -f fixFrontmatter.sed  $OUTFILE > $INFILE

and the sed script, fixFrontmatter.sed, looks like this:

Full entry …

Elisp for Hugo

Now that I am writing all my blog posts using orgmode, I wanted a way to create the file I need for a new post automatically. I couldn't find quite what I wanted, so here is my attempt and writing some elisp to make it happen.

  (defun s-dashed-words (words)
     (replace-regexp-in-string "[^a-z0-9]+" "-" words)))

  (defun ps/new-hugo-post (title &optional)
    "Create and visit a new draft blog post for the prompted TITLE.

     The file for the blog post conforms to the path schema of posts
    (interactive "sTitle: ")

    (let* ((post-dir (concat ps/data "Code/Websites-source/petersmith/content/blog/"
                               (format-time-string "%Y%m%d-") (s-dashed-words title) "/"))
           (post-fpath (concat post-dir ""))
           (post-slug (s-dashed-words title))
           (post-date (format-time-string "%+4Y-%m-%dT%H:%M:%S%:z")))

      (make-directory post-dir t)

      (write-region (concat
                 "\n#+title: " title
                 "\n#+date: " post-date
                 "\n#+lastmod: " post-date
                 "\n#+categories[]: Tech"
                 "\n#+tags[]: "
                 "\n#+slug: " post-slug
                 "\n#+draft: False"
                nil (expand-file-name post-fpath) nil nil nil t)

  (find-file (expand-file-name post-fpath))))

A good chunk of the code came from a post by Jeremy Friesen at Take on Rules. Thanks! (And that reminds me, I still have to get webmentions working).

I modified Jeremy's code a bit to allow for the fact that I use Hugo's page bundles.

Full entry …

Bye bye Confluence

I have been using a Confluence wiki space in my teaching of MGMT300 since at least 2013.

Before that I used a self-host version of Mediawiki. That worked really well, and I had it integrated with our SSO (Single Sign On) which was Shibboleth at that time. I only stopped using Mediawiki when they discontinued the blogging component; I guess it wasn't really needed for Wikipedia (which runs on Mediawiki).

Before that I used self-hosted MovableType blogs.

It all came about because I got one or two students in the class to start blogging about what they were doing with Mikesbikes (which was the central experiential component of MGMT300). This grew into me having the whole class do it and framing it as a learning journal.

Anyway, tens of thousands of student posts later (say 10 years, of 10 posts per semester, across 100 students is about 10,000 posts plus double that amount of comments makes it 30,000 contributions to the wiki), I'm finally moving away from the course that Darl Kolb, Joline Francoeur, and I first re-invented in 1999. That's a long time to be teaching a course (especially as it has remained largely unchanged – the basic formula worked so well).

The new folk taking over the course—who should do an excellent job—won't be using the wiki. So, I have backed up the wiki, and kicked of the deletion of the MGMT300 wiki space.

I guess it's the end of an era.

Full entry …

Images and page bundles

I use a feature of Hugo called page bundles.

With pages bundles, resources such as images are kept in the same directory as the content of a post. This keeps things a little more simple, but it does mean that OrgMode's linking system is broken.

Until now, to include an image I've been using a shortcode such as this:

{ {< img src="AaronParecki-Sparklines.png"
   title="Screenshot of sparklines from Aaron Parecki"
   width="50%" >}}

Which calls themes/NewPapyrus/layouts/shortcodes/img.html

{{ $image := .Page.Resources.GetMatch (.Get "src" )}}
{{ $title := .Get "title" }}
{{ $class := .Get "class" }}
{{ $alt   := .Get "alt" }}
{{ $width := .Get "width" }}
  <img src="{{ $image.RelPermalink }}" alt="{{ $alt }}" class="{{ $class }}" width="{{ $width }}" />
  <figcaption><h4>{{ $title }}</h4></figcaption>

That does the job.

Full entry …

Of tags and categories

I am changing how I use tags and categories in Hugo.

I have to main type of content, my journal entries and my blog entries. Generally, my journal entries are about University life, especially teaching and research, whereas my blog entries are about everything else. So, I have decided that my main categories for each should be:

  • Journal

    • Research

    • Teaching

    • Service

  • Blog

    • Home

    • Travel

    • Tech

    • Arts - the more cultured side of life; movies, theatre, books

    • Work - work things that aren't fit for my journal

And then I will use tags for a more fine-grained, ad-hoc topics within those categories.

Now I just need to rework all my posts to reflect that. But, I was going through them anyway, as I continues to move from using Markdown to Orgmode for my posts.

Full entry …

Posts by month

I want to get a count of blog posts by month. Actually, I want to do that for each of my types of content. Ultimately, the idea is to generate a sparkline, rather like Aaron Parecki does on his website.

Screenshot of sparklines from Aaron Parecki's website

The code I finally ended up with looks like this. First I have a partial template posting-status.html. It cycles through all the types of sections I have and draws a sparkline, a count of posts, and a link to the section. I don't think the code is pretty, but it seems to work.

{{ range .Pages.GroupBy "Section" }}
{{ $MyKey := .Key }}

 <ul class="sparklines">
   {{ range .Pages }}
      <embed {{ printf "src=%q" ( replaceRE "(\\s)" "" (partial "sparkline-data" (dict "context" . "WhatSection" $MyKey ))) | safeHTMLAttr }}  width="100" height="15">
     {{ len .Pages }} <a href="{{ .Permalink }}">{{ .Title }}</a> 
   {{ end }}
{{ end }}

Then there is another partial that gets the data needed for the sparkline. This took a lot of messing around because (a) Hugo was keen to HTML encode the data, and (b) I could figure way to build an 'array' of the count of posts by month. Anyway, in the end sparkline-data.html looks like this:

Full entry …

Harnessing the diversity of strategy-as-practice research

Kohtamäki, M., Whittington, R., Vaara, E., & Rabetino, R. (2021). Making connections: Harnessing the diversity of strategy-as-practice research. International Journal of Management Reviews.

This paper 'takes stock' of where we are with strategy-as-practice research. Through a tidy systematic literature review they identify six central themes, that they label as: (1) praxis, (2) sensemaking, (3) discursive, (4) sociomaterial, (5) institutional, and (6) process. For each of these they consider the theme itself, the key theoretical influences, and the characteristic methodological approaches.

All-in-all, it provides a well considered snapshot of where we are.

One thing that stood out for me was the comment that:

However, advocates of ‘flat ontologies’ are sceptical of the hierarchical layering of the world into micro and macro, warning against a narrow concern for the local and a curtailed understanding of broader connections (Gond et al., 2018; Latour, 2005). (p.11-12).

The work that I've been doing with Eli Krull using microfoundations would seem to hold a lot of promise in addressing that. Perhaps that should be the next paper we do. I think this could be good as the authors of the paper explicitly mention microfoundations as one of the 'blindspots' of S-a-P.


Indeed, the ‘micro’ focus on empirical detail in much praxis-orientated SAP research has prompted accusations of ‘micro-isolationism’, a tendency to explain activities entirely in local terms (Seidl & Whittington, 2014). Micro-isolationism underplays the influences of practices that extend beyond the particular organization at hand (p. 12).

I had, sometime ago, theorised this problem away, but I never got around to publishing it (although I have talk with colleges at EGOS about it on a few occasions, including one on-line event last year. Maybe it's time to put pen to paper on it.

Time to start writing.

Full entry …

Emacs and macrons: A bit better typograghy

I seem to be typing more words and expressions in Māori nowadays. That sees me wanting to use macrons on letters. (i.e., ā Ā ē Ē ī Ī ō Ō ū Ū).

When running Windows 10, that's not too hard; I select a Māori keyboard and away I go.

However, that's not the case under Emacs. I run Emacs under WSL2, and although my keyboard on the 'Windows' side says "English (New Zealand) Maori keyboard", Emacs doesn't see that. So I need to use short-cuts, etc., when wanting to type letters with macrons.

Now I can do it using the good old C-x 8 to get to all (and any) letters/alphabets. But it's tiresome.

Enter Xah Lee and his Unicode tutorial. I used his approach of binding some keys to insert math symbols, and changed it to insert characters with macrons.

  ;; set keys to insert macrons
  (define-key key-translation-map (kbd "<f9> a") (kbd "ā"))
  (define-key key-translation-map (kbd "<f9> A") (kbd "Ā"))
  (define-key key-translation-map (kbd "<f9> e") (kbd "ē"))
  (define-key key-translation-map (kbd "<f9> E") (kbd "Ē"))
  (define-key key-translation-map (kbd "<f9> i") (kbd "ī"))
  (define-key key-translation-map (kbd "<f9> I") (kbd "Ī"))
  (define-key key-translation-map (kbd "<f9> o") (kbd "ō"))
  (define-key key-translation-map (kbd "<f9> O") (kbd "Ō"))
  (define-key key-translation-map (kbd "<f9> u") (kbd "ū"))
  (define-key key-translation-map (kbd "<f9> U") (kbd "Ū"))

The result is to type the Ā, I just press f9 A; to get an ā, I press f9 a. That's about as easy as I can imagine it being.

Full entry …

Second Steps in IndieWeb

After my first steps to IndieWeb, I got a really helpful message from Robbi Nespu. Alas, I've not (yet) got webmentions working in any real way, and the page he commented on had a broken URL (all my problems, not Robbi's).

He said:

Hello Peter Smith, How going? I also using Hugo, the getting webmention response working is easier if using a javascript called as PlaidWeb/webmention.js

Some tips from my experience

  • Setup the h-card because it important and needed for indieAuth (to use some external services such as

  • You may use to inspect if the HTML are parse correctly, you can submit the URL or just paste the raw HTML (even with localhost / addressed inside the source code, it working very well). It save my time during debugging.

  • I also use to preview (check) if all link inside h-entry support webmention. You also can manually send webmention by give a source and target from there.

  • Lastly, validate published web using get your website until level 3.

Hope this helpful 😀

So, what's my progress so far? (beside's Robbi's smiley face emoji not displaying correctly in emacs)

  • Level 1: Become a citizen of the IndieWeb

    1. Get your own domain name: Done. Many years ago.

    2. Set up Web Sign In: That was easy. Or it was until I decided to not use <link rel="me" href= ..../>. And once I had that working I too the time to break it again.

  • Level 2: Publishing on the IndieWeb

    1. Check your homepage h-card: I really should read the specs more closely. I bashed my head against a brick wall for a while with this. Even though I used bits of HTML from Aaron Parecki and from Chris Aldrich, it still took too much time.

    2. Check your posts are marked up with h-entry: Not so hard, although I have had to tweak the layout of may pages somewhat. Categories, aren't elegant yet.

  • Level 3: Add the ability to send Webmentions to other IndieWeb sites

This is a work in progress. I can do it manually using, say, but I've yet to automate things. The bigger challenge is getting other people's Webmentions to appear on my site.

Full entry …