added git revision info to bottom

of pages (if available) ; add 'back to top' link to footer ; add shortcodes for change log ; add shortcode for back to top to be used with headings
This commit is contained in:
KemoNine 2023-03-18 18:46:32 -04:00
parent 5932643fee
commit cf83cf1925
8 changed files with 16 additions and 17 deletions

View file

@ -7,6 +7,7 @@ timeZone = 'UTC'
enableEmoji = true
enableRobotsTXT = true
enableGitInfo = true
rssLimit = 25
ignoreFiles = [ '.gitignore', '.gitkeep' ]

View file

@ -7,6 +7,7 @@ timeZone = 'UTC'
enableEmoji = true
enableRobotsTXT = true
enableGitInfo = true
rssLimit = 25
ignoreFiles = [ '.gitignore', '.gitkeep' ]

View file

@ -1,7 +1,7 @@
{{ partial "header.html" . }}
<div class="article-meta">
<h1><span class="title">{{ .Title | markdownify }}</span></h1>
{{ with .Params.author }}<h2 class="author">{{ . }}</h2>{{ end }}
{{ with .Params.author }}<h2 class="author">By: {{ . }}</h2>{{ end }}
{{ if (gt .Date 0) }}<h4 class="date">Published: {{ .Date.Format "2006/01/02" }}</h4>{{ end }}
{{ if (gt .Lastmod 0) }}<h4 class="date">Last Modified: {{ .Lastmod.Format "2006/01/02" }}</h4>{{ end }}
<p class="terms">

View file

@ -2,23 +2,12 @@
{{ partial "foot_custom.html" . }}
{{ with .Site.Params.footer }}
<hr/>
{{ replace . "{Year}" now.Year | markdownify}}
<a href="#top">Back to top</a>
<br />{{ replace . "{Year}" now.Year | markdownify}}
{{ end }}
{{ if .File.Path }}
{{ $.Scratch.Set "FilePath" .File.Path }}
{{ $RmdFile := (print .File.BaseFileName ".Rmd") }}
{{ $Files := readDir (print "content/" .File.Dir) }}
{{ if (where $Files "Name" $RmdFile) }}
{{ $.Scratch.Set "FilePath" (print .File.Dir $RmdFile) }}
{{ else }}
{{ $RmdFile := (print .File.BaseFileName ".Rmarkdown") }}
{{ if (where $Files "Name" $RmdFile) }}
{{ $.Scratch.Set "FilePath" (print .File.Dir $RmdFile) }}
{{ end }}
{{ end }}
{{ with .Site.Params.GithubEdit}}
| <a href="{{ . }}{{ $.Scratch.Get "FilePath" }}">Edit this page</a>
{{ end }}
{{ if .GitInfo}}
<br />
Revision <a href="https://github.com/mcrosson/accessible.tips/commit/{{ .GitInfo.Hash }}" rel="noopener">{{ .GitInfo.Hash }}</a>
{{ end }}
</footer>
</body>

View file

@ -0,0 +1 @@
<a class="back_to_top" href="#top">Back to top</a>

View file

@ -0,0 +1,2 @@
<dt><strong>{{ .Get 0 }}</strong></dt>
<dd>{{ .Get 1 }}</dd>

View file

@ -0,0 +1,3 @@
<dl>
{{ .Inner | safeHTML }}
</dl>

View file

@ -17,6 +17,7 @@ body {
.terms { font-size: .9em; }
.menu, .article-meta, footer { text-align: center; }
.title { font-size: 1.1em; }
.back_to_top { font-size: .85em }
footer a { text-decoration: none; }
hr {
border-style: dashed;
@ -59,3 +60,4 @@ table {
table thead th { border-bottom: 1px solid #ddd; }
th, td { padding: 5px; }
thead, tfoot, tr:nth-child(even) { background: #eee; }