diff options
-rw-r--r-- | config.toml | 1 | ||||
-rw-r--r-- | layouts/_default/single.html | 78 |
2 files changed, 42 insertions, 37 deletions
diff --git a/config.toml b/config.toml index f3285f1..28e20f2 100644 --- a/config.toml +++ b/config.toml @@ -7,6 +7,7 @@ enableGitInfo = true [params] defaultDescription = "Welcome to my blog!" + repoUrl = "https://michal.sapka.me/git/mms/site" [taxonomies] category = 'category' diff --git a/layouts/_default/single.html b/layouts/_default/single.html index ee09c88..4fc3986 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -1,40 +1,44 @@ {{ define "main" }} -<article> - {{ .Page.Content }} - - {{- if not (in .Params.category "pages") }} - - {{- if not (eq .Page.Type "special") }} - - {{ $pubdate := .PublishDate.Format "January 2, 2006" }} - {{ $lastmod := .Lastmod.Format "January 2, 2006" }} - - <div class="publish-date"> - {{ if eq $pubdate $lastmod }} - Published: - <time datetime="{{.PublishDate.Format "2006-01-02" }}">{{ $pubdate }}</time> - {{ else }} - - ; updated: - <time datetime="{{.Lastmod.Format "2006-01-02" }}">{{ $lastmod }}</time> - {{ end }} - </div> - - - - <aside> - <h2>Author</h2> - <p> - Hey! I'm Michał Sapka, a computer programmer living in Kraków, Poland. This website is not dedicated to any particular one thing. Instead, I write whatever interests me most at the moment. No content here is auto-generated, so any bugs, problems, or controversies are entirely on me! - </p> - <p> - I don't have any commenting system, but comments over <a href="/me/contact">email</a> are more than welcome! - </p> - </aside> - {{- end }} - -</article> -{{ end }} - + <article> + {{ .Page.Content }} + + {{- if not (in .Params.category "pages") }} + {{- if not (eq .Page.Type "special") }} + {{ $pubdate := .PublishDate.Format "2006-01-02" }} + {{ $lastmod := .Lastmod.Format "2006-01-02" }} + + {{ $file := .File.LogicalName }} + {{ $path := .File.Path }} + {{ $lastmodhash := .GitInfo.Hash }} + + <div class="publish-date"> + {{ if eq $pubdate $lastmod }} + Published: <time datetime="{{ $pubdate }}"> + <a href="{{$.Site.Params.repoUrl}}/commit/{{$lastmodhash}}">{{ $lastmod }}</a> + </time> + {{ else }} + Originally published: + <time datetime="{{ $pubdate }}">{{ $pubdate }}</time>; + updated: <time datetime="{{ $lastmod }}"> + <a href="{{$.Site.Params.repoUrl}}/commit/{{$lastmodhash}}">{{ $lastmod }}</a> + </time> + {{ end }} + </div> + + <aside> + <h2>Author</h2> + <p> + Hey! I'm Michał Sapka, a computer programmer living in Kraków, Poland. + This website is not dedicated to any particular one thing. + Instead, I write whatever interests me most at the moment. + No content here is auto-generated, so any bugs, problems, or controversies are entirely on me! + </p> + <p> + I don't have any commenting system, but comments over <a href="/me/contact">email</a> are more than welcome! + </p> + </aside> + {{- end }} + {{- end }} + </article> {{ end }} |