konakona.png konata.gif autism.png drew.png panzergranate.gif debian-powered.gif hugo.png touhou.gif monero-now.gif wiby.gif notepad-fulvio.gif svenbutton.gif ls.jpg
Index Posts Photos Guestbook About  Gitea? DMCA? 

Log


diowo’s shitty commit log aka. modifications to the site, etc…


Wanna do this on your Hugo site?


Amount of commits: 256


Instructions


You can follow this example if you want to also make this section on your site.


I am using Powershell because I am on Windows but you can adapt it into bash if you want.


1git log `
2    --pretty=format:"<li><b class='recent-date'>%ad: </b>%s</li>" `
3    --date=format:'%Y-%m-%d @ %H:%M' | `
4Out-File -Encoding UTF8 commit.log

Now you can make this a Shortcode or template on your Hugo site.


 1{{ $commits := readFile "commit.log" }}
 2{{ $lines := split $commits "\n" }}
 3{{ $len := sub (len $lines) 1 }}
 4
 5<br>
 6<p>Amount of commits: {{ $len }}</p>
 7
 8<ul>
 9{{ range $lines }}
10    {{ if ne . "" }}
11        {{ . | safeHTML }}
12    {{ end }}
13{{ end }}
14</ul>