diff --git a/assets/css/style-dark.css b/assets/css/style-dark.css index cfd62de..8c10e58 100644 --- a/assets/css/style-dark.css +++ b/assets/css/style-dark.css @@ -3,7 +3,6 @@ --bg-color: #101010; --text-color: #8f8f8f; --header-color: #dedede; - --accent-color: #7b5b4c; } body { background-image: url(/img/winter-dark.png); diff --git a/layouts/_default/stats.amp.html b/layouts/_default/stats.amp.html new file mode 100644 index 0000000..e69de29 diff --git a/layouts/_default/stats.html b/layouts/_default/stats.html new file mode 100644 index 0000000..11414b8 --- /dev/null +++ b/layouts/_default/stats.html @@ -0,0 +1,137 @@ +{{ define "main" }} + +{{ partial "header.html" . }} +
+
+
+ {{ .Content }} + {{ $tags := .Site.Taxonomies.tags }} + {{ $posts := where site.RegularPages "Type" "blog" }} + + {{ $postCount := len $posts }} + + {{ $scratch := newScratch }} + {{ $scratch.Set "longCount" 0 }} + {{ range $posts }} + + {{ $scratch.Add "wordcount" .WordCount }} + + {{ if ge .WordCount ($scratch.Get "longCount") }} + {{ $scratch.Set "longestPost" . }} + {{ $scratch.Set "longCount" .WordCount }} + {{ end }} + {{ end }} + + + {{ $mostPopularTag := index .Site.Taxonomies.tags.ByCount 0 }} + + {{ $wordCount := $scratch.Get "wordcount" }} + {{ $avgPostLength := div $wordCount $postCount }} + + + {{ range last 1 $posts }} + {{ $numYears := div (sub now.Unix .Date.Unix) 31536000 }} + + + {{ end }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Years Blogging{{ $numYears | lang.NumFmt 0 }}
Total Posts Published{{ $postCount | lang.NumFmt 0 }}
Total Words Written{{ $wordCount | lang.NumFmt 0 }}
Average Words per Post{{ $avgPostLength | lang.NumFmt 0 }}
Number of Topics{{ len $tags | lang.NumFmt 0 }}
Most Popular Topic + {{ with $mostPopularTag }} + {{ .Page.Title }} with {{ .Count }} posts + {{ end }} +
Longest Post Published + {{ with $scratch.Get "longestPost" }} + {{ .Title }} with {{ .WordCount }} words + {{ end }} +
Total Wikipedia Edits + {{ $data := getJSON "https://en.wikipedia.org/w/api.php?action=query&list=users&ususers=BrandonRozek&usprop=editcount&format=json" }} + {{ range first 1 $data.query.users }} + {{ .editcount }} + {{ end }} +
Total OpenStreetMap Edits + {{ $data := getJSON "https://api.openstreetmap.org/api/0.6/user/16068861.json" }} + {{ $data.user.changesets.count }} +
+ + {{ $grouped := $posts.GroupByDate "2006" }} + +

Posts Per Year

+ +
+ + +
+ + + + {{ $chartPre := "{type: 'line',data: {labels: [" }} + {{ $chartYearKeys := trim ($scratch.Get "yearKeys") ","}} + {{ $chartYearCount := trim ($scratch.Get "yearCount") ","}} + {{ $chartMid := "],datasets: [{label: 'Posts Published',data: [" }} + {{ $chartPost := "],backgroundColor: 'rgb(54, 128, 56)',borderColor: 'rgb(54, 128, 56)',borderWidth: 3}]},options: {maintainAspectRatio: false, animation: false, scales: {y: {ticks: {beginAtZero: true}}}}}" + }} + + + {{ $chartData := printf "%s" $chartPost | printf "%s%s" $chartYearCount | printf "%s%s" $chartMid | printf "%s%s" $chartYearKeys | printf "%s%s" $chartPre | printf "%s" }} + + +
+
+
+{{ end }}