Recent Posts

Full Category Index

Posts in “Hugo”

Embedded Gists

Sat, Jul 5, 2014

Syntax Highlighting - or Embedded Gists

I was quite excited by the inline syntax highlighting that Hugo provides via the python plugin Pygments. But also wanted to try embedding gists

So here is an example…

<p>def digit_sum(n):
    s = 0
    while n:   # while n is ‘truthy’ for an integer that means not 0
        s = s + (n % 10)   # the sum is the sum + the remainder of dividing the incoming number (n) by 10  157 % 10 = 7
        n = n / 10         # n = the integer of n / 10   int(15.7) = 15
    return s</p></p>

<p>print digit_sum(157)</p>

<p>”’
calling digit_sum(157)</p>

<h2>loop  | s   | n   | n % 10  | n / 10</h2>

<p><p>0     | 0   | 157 |   7     |  15
1     | 7   | 15  |   5     |  1
2     | 12  | 1   |   1     |  0
3     | 13  | 0   |         |<br />
”’</p>

But then thought perhaps it is better to embed gists than have inline markup in blog posts then folk can fork the code and comment there.

So on embedding a gist as follows (but without syntax highlighting) failed…


Making Your Own Summary

Sat, Jun 28, 2014

Hugo allows you to specify where the summary stops - and allows the full markdown including shortcodes.

You just need to construct the first bit of your article so that it makes a nice summary and then end it with…

(of course dont include the space :) )


Moving to Hugo

Thu, May 29, 2014

I decided that I should blog under my danmux.com domain - I often use danmux around the internet, sometimes danmull, but normally danmux for tech type things, so it makes sense.

danmux because the x has always been a notable part of my name - and mux reminds me of my electrical engineering days, and I think humans multiplex all the time, there it is.


Deploying blog with docker and hugo

Sun, May 4, 2014
Prelude Recently I moved my jabber-server to DigitalOcean VPS. Run Prosody in docker was so easy, that I decided create this blog. And of course deploy it with docker! Content At first we need container with templates and content for blog generation. I used next dockerfile: FROM debian:jessie RUN apt-get update && apt-get install --no-install-recommends -y ca-certificates git-core RUN git clone http://github.com/LK4D4/lk4d4.darth.io.git /src VOLUME ["/src"] WORKDIR /src ENTRYPOINT ["git"] CMD ["pull"] There is no magic here: just clone repo to /src (it will be used below), and update it on container start.