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:
parent
5932643fee
commit
cf83cf1925
|
@ -7,6 +7,7 @@ timeZone = 'UTC'
|
||||||
|
|
||||||
enableEmoji = true
|
enableEmoji = true
|
||||||
enableRobotsTXT = true
|
enableRobotsTXT = true
|
||||||
|
enableGitInfo = true
|
||||||
rssLimit = 25
|
rssLimit = 25
|
||||||
|
|
||||||
ignoreFiles = [ '.gitignore', '.gitkeep' ]
|
ignoreFiles = [ '.gitignore', '.gitkeep' ]
|
||||||
|
|
|
@ -7,6 +7,7 @@ timeZone = 'UTC'
|
||||||
|
|
||||||
enableEmoji = true
|
enableEmoji = true
|
||||||
enableRobotsTXT = true
|
enableRobotsTXT = true
|
||||||
|
enableGitInfo = true
|
||||||
rssLimit = 25
|
rssLimit = 25
|
||||||
|
|
||||||
ignoreFiles = [ '.gitignore', '.gitkeep' ]
|
ignoreFiles = [ '.gitignore', '.gitkeep' ]
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{{ partial "header.html" . }}
|
{{ partial "header.html" . }}
|
||||||
<div class="article-meta">
|
<div class="article-meta">
|
||||||
<h1><span class="title">{{ .Title | markdownify }}</span></h1>
|
<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 .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 }}
|
{{ if (gt .Lastmod 0) }}<h4 class="date">Last Modified: {{ .Lastmod.Format "2006/01/02" }}</h4>{{ end }}
|
||||||
<p class="terms">
|
<p class="terms">
|
||||||
|
|
|
@ -2,23 +2,12 @@
|
||||||
{{ partial "foot_custom.html" . }}
|
{{ partial "foot_custom.html" . }}
|
||||||
{{ with .Site.Params.footer }}
|
{{ with .Site.Params.footer }}
|
||||||
<hr/>
|
<hr/>
|
||||||
{{ replace . "{Year}" now.Year | markdownify}}
|
<a href="#top">Back to top</a>
|
||||||
{{ end }}
|
<br />{{ replace . "{Year}" now.Year | markdownify}}
|
||||||
{{ 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 }}
|
{{ end }}
|
||||||
|
{{ if .GitInfo}}
|
||||||
|
<br />
|
||||||
|
Revision <a href="https://github.com/mcrosson/accessible.tips/commit/{{ .GitInfo.Hash }}" rel="noopener">{{ .GitInfo.Hash }}</a>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</footer>
|
</footer>
|
||||||
</body>
|
</body>
|
||||||
|
|
1
themes/hugo-xmin/layouts/shortcodes/back_to_top.html
Normal file
1
themes/hugo-xmin/layouts/shortcodes/back_to_top.html
Normal file
|
@ -0,0 +1 @@
|
||||||
|
<a class="back_to_top" href="#top">Back to top</a>
|
2
themes/hugo-xmin/layouts/shortcodes/change.html
Normal file
2
themes/hugo-xmin/layouts/shortcodes/change.html
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
<dt><strong>{{ .Get 0 }}</strong></dt>
|
||||||
|
<dd>{{ .Get 1 }}</dd>
|
3
themes/hugo-xmin/layouts/shortcodes/changelog.html
Normal file
3
themes/hugo-xmin/layouts/shortcodes/changelog.html
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
<dl>
|
||||||
|
{{ .Inner | safeHTML }}
|
||||||
|
</dl>
|
|
@ -17,6 +17,7 @@ body {
|
||||||
.terms { font-size: .9em; }
|
.terms { font-size: .9em; }
|
||||||
.menu, .article-meta, footer { text-align: center; }
|
.menu, .article-meta, footer { text-align: center; }
|
||||||
.title { font-size: 1.1em; }
|
.title { font-size: 1.1em; }
|
||||||
|
.back_to_top { font-size: .85em }
|
||||||
footer a { text-decoration: none; }
|
footer a { text-decoration: none; }
|
||||||
hr {
|
hr {
|
||||||
border-style: dashed;
|
border-style: dashed;
|
||||||
|
@ -59,3 +60,4 @@ table {
|
||||||
table thead th { border-bottom: 1px solid #ddd; }
|
table thead th { border-bottom: 1px solid #ddd; }
|
||||||
th, td { padding: 5px; }
|
th, td { padding: 5px; }
|
||||||
thead, tfoot, tr:nth-child(even) { background: #eee; }
|
thead, tfoot, tr:nth-child(even) { background: #eee; }
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue