March notes
This is a recurring post featuring things I’ve learned in the last quarter or commands I’ve used recently. The idea behind it is that would like to organize my notes, because I often find me googling the same stuff over and over again.
Placing hyphens (-) in hugo template tags removes whitespaces from the rendered HTML.1
{{- range $i, $e := .Params.tags -}}
{{ if $i }},{{ end }}
<a href="{{ "/tags/" | relLangURL }}{{ . | urlize }}">{{ . }}</a>
{{- end -}}
Remove the last commit if you have commited it by mistake, but without removing changes:
git reset HEAD~1 --soft
Lately I’ve switched from synchronizing my git repositories with SSL to SSH, as it doesn’t require me to type my login and password each time. So this is the command for changing the remote’s URL:
git remote set-url origin git@github.com:user/repository.git