Mermaid Diagrams

 
graph LR; A(Mermaid) B(Diagrams) C(Are) D(Awesome) A-->B; B-->C; C-->D; style B fill:#f9f,stroke:#333,stroke-width:4px click B "https://mermaidjs.github.io" "Mermaid!"

»

Hugo Date Operations (osgav epoch)

Author image osgav | |
 created: 19/01/2019 updated: 19/01/2019 I wanted to make an ‘osgav epoch’ counter thing, and so I did, like so… (see Blog Archive on my tags page) <h6>blog archive</h6> <br /> $pages := (where (where .Site.Pages "Type" "post") "IsPage" true) range first 99 $pages $t := (time "2016-06-05") <!-- date of osgav.run first post --> $delta := $t.Sub (time .Date) $osgav_epoch_negative := int (div $delta.Hours 24) $osgav_epoch := int (sub 0 $osgav_epoch_negative) <a href=" . »

Mermaid Diagrams on Hugo

 created: 19/01/2019 updated: 19/01/2019 how do you get Mermaid diagrams on a Hugo blog 1 Under themes/casper/layouts/ I created a shortcodes folder (I didn’t have one already, you might) and added mermaid.html: <script src="/js/mermaid_dist_8.0.0-rc.6.js"></script> <div class="mermaid"> {{ .Inner }} </div> 2 Then under themes/casper/static/js/ I added the mermaid_dist_8.0.0-rc.6.js file referenced in the snippet above (Mermaid JS itself came from here) tada I didn’t figure any of this out I was inspired by this excellent person who had already described how they added Mermaid to their Hugo site. »

Hugo TravisCI Pipeline Broken?

 

TL;DR

If your .travis.yml install section looks like this and the build is failing to install Hugo…

 install:
 - go get github.com/spf13/hugo

…then try updating it to download a specific version of the hugo binary:

install:
- export VER=0.18.1
- wget https://github.com/spf13/hugo/releases/download/v${VER}/hugo_${VER}_Linux-64bit.tar.gz
- tar xvzf hugo_${VER}_Linux-64bit.tar.gz
- mkdir -p $GOPATH/bin
- cp hugo_${VER}_linux_amd64/hugo_${VER}_linux_amd64 $GOPATH/bin/hugo

Why? Read on…

»