Setup_hugo

Install Hugo

Create a new site and assign theme

hugo new site sqltools

cd sqltools

git init

git submodule add https://github.com/McShelby/hugo-theme-relearn.git themes/hugo-theme-relearn

echo theme = "hugo-theme-relearn" >> config.toml

hugo server -D

Now you should see some empty site in http://localhost:1313

Add to github

if git not initiated you might need to run

git config --global user.email "you@example.com"
git config --global user.name "Your Name"

git add . && git commit -m "initial commit"

Create a post

This uses the default archetype

hugo new  basics/_index.md

Create a chapter page

hugo new --kind chapter basics/_index.md

Image handling

layouts\shortcodes\imgproc.html

{{ $img := .Page.Resources.GetMatch (printf "*%s*" (.Get 0)) }}
{{ $command := .Get 1 }}
{{ $options := .Get 2 }}
{{ if eq $command "Fit"}}
  {{ $img = $img.Fit $options }}
{{ else if eq $command "Resize"}}
  {{ $img = $img.Resize $options }}
{{ else if eq $command "Fill"}}
  {{ $img = $img.Fill $options }}
{{ else if eq $command "Crop"}}
  {{ $img = $img.Crop $options }}
{{ else }}
  {{ errorf "Invalid image processing command: Must be one of Crop, Fit, Fill or Resize."}}
{{ end }}
<figure style="padding: 0.25rem; margin: 2rem 0; ">
  <img style="max-width: 100%; width: auto; height: auto;" src="{{ $img.RelPermalink }}" width="{{ $img.Width }}" height="{{ $img.Height }}">
</figure>

add picture in same folder as post. Call it with: