grgr.me

latest commits to https://grgr.me/
Log | Files | Refs

commit 420470398b6016e6029fb5632bedf47d6687a75b
parent ee919e10b00a15ded42fd233fa0a96f02432e381
Author: corndog <cauchyn@firemail.cc>
Date:   Tue, 23 Oct 2018 21:38:32 -0700

Template "proseheader" for last mod, word count

Diffstat:
in/me/index.md | 2+-
in/sits/index.md | 2++
in/static/style.css | 4++++
site.tmpl | 12++++++++++--
wordcount.lua | 2+-
5 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/in/me/index.md b/in/me/index.md @@ -32,7 +32,7 @@ description: Some things I like. # Just a few of my favorite things -<small>[*Last modified: {{ template "date" .ModTime }}*] [*\$timetoread\$*]</small> +{{ template "proseheader" .ModTime }} Around 2010 I read a view on identity claiming people are the collection of their answers to *I love...*[^where]. For a while I kept a short list of links to refer to when prompted diff --git a/in/sits/index.md b/in/sits/index.md @@ -5,6 +5,8 @@ description: A networked versus vertically scrolling shooter in progress. # A competitive shmup for you, me and [Yumemi](http://store.steampowered.com/app/316720/) +{{ template "proseheader" .ModTime }} + ![A screenshot of v0.02](./screenshot.png) Shimmers in the Stars was the production name of a game I was making with LÖVE[(0)][0]. diff --git a/in/static/style.css b/in/static/style.css @@ -74,6 +74,10 @@ button:hover > img.embed { display: block; } +.bold-on-hover:hover { + font-weight: 700; +} + .nowrap { white-space: nowrap; } diff --git a/site.tmpl b/site.tmpl @@ -27,8 +27,16 @@ </html> {{ end }} -{{ define "date" }} -<time datetime="{{ .Format "2006-01-02" }}">{{ .Format "02 Jan 2006" }}</time>{{end}} +{{ define "moddate" }} +<em class="bold-on-hover"> +Last modified: <time datetime="{{ .Format "2006-01-02" }}">{{ .Format "02 Jan 2006" }}</time> +</em> +{{end}} + +{{ define "proseheader" }} +<small>[{{ template "moddate" . }}] +[<em class="bold-on-hover">\$timetoread\$</em>]</small> +{{end}} {{ define "page" }} {{ template "header" . }} diff --git a/wordcount.lua b/wordcount.lua @@ -29,7 +29,7 @@ end function replace(el) tooltip = words .. " words at a speed of " .. wpm .. " wpm." tooltip = pandoc.Attr("", {}, {{"title", tooltip}}) - time_to_read = "~" .. minutes .. " minutes of text.*" + time_to_read = "~" .. minutes .. " minutes of text*" if el.text == "$timetoread$" then return pandoc.Span(time_to_read, tooltip) else