mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-21 21:35:28 +02:00
Merge commit '374d184e6747678364fd61f5faf328ec9205eb6b'
This commit is contained in:
36
docs/layouts/maintenance/list.html
Normal file
36
docs/layouts/maintenance/list.html
Normal file
@@ -0,0 +1,36 @@
|
||||
{{ define "main" }}
|
||||
<div class="w-100 ph4 pb5 pb6-ns pt1 mt4 pt3-ns">
|
||||
<div class="flex-l">
|
||||
<div class="order-2 w-100 w-20-l ph5-m ph0-l mb4 sticky">
|
||||
<aside class="fixed-lTK mw5-l right-0 f6 bl-l b--moon-gray pv4 pv0-ns ph4-l nested-list-reset nested-links nested-copy-line-height">
|
||||
<p class="b">What's on this Page</p>
|
||||
<ul>
|
||||
<li><a href="#last-updated">Last Updated</a></li>
|
||||
<li><a href="#least-recently-updated">Least Recently Updated</a></li>
|
||||
<li><a href="#todos">Pages marked with TODO</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
</div>
|
||||
<div class="w-100">
|
||||
{{ $byLastMod := .Site.RegularPages.ByLastmod }}
|
||||
{{ $recent := ($byLastMod | last 30).Reverse }}
|
||||
{{ $leastRecent := $byLastMod | first 10 }}
|
||||
<h2 id="last-updated">Last Updated</h2>
|
||||
{{ partial "maintenance-pages-table" $recent }}
|
||||
<h2 id="least-recently-updated">Least Recently Updated</h2>
|
||||
{{ partial "maintenance-pages-table" $leastRecent }}
|
||||
|
||||
{{/* Don't think this is possible with where directly. Should investigate. */}}
|
||||
{{ .Scratch.Set "todos" slice }}
|
||||
{{ range .Site.RegularPages }}
|
||||
{{ if .HasShortcode "todo" }}
|
||||
{{ $.Scratch.Add "todos" . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
<h2 id="todos">Pages marked with TODO</h2>
|
||||
{{ partial "maintenance-pages-table" (.Scratch.Get "todos") }}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
24
docs/layouts/partials/maintenance-pages-table.html
Normal file
24
docs/layouts/partials/maintenance-pages-table.html
Normal file
@@ -0,0 +1,24 @@
|
||||
<table class="collapse ba br2 b--black-10 pv2 ph3">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="pv2 ph3 tl f6 fw6 ttu">LastMod</th>
|
||||
<th class="pv2 ph3 tl f6 fw6 ttu">Link</th>
|
||||
<th class="pv2 ph3 tl f6 fw6 ttu">GitHub</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{ range . }}
|
||||
<tr class="striped--light-gray">
|
||||
<td class="pv2 ph3">{{ .Lastmod.Format "2006-01-02" }}</td>
|
||||
<td class="pv2 ph3">
|
||||
<a href="{{ .Permalink }}">{{ .Title }}</a>
|
||||
</td>
|
||||
<td class="pv2 ph3">
|
||||
<a href="{{.Site.Params.ghrepo}}blob/master/content/{{.Path}}">
|
||||
{{ with .GitInfo }}{{ .Subject }}{{ else }}Source{{ end }}
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
{{ end }}
|
||||
</tbody>
|
||||
</table>
|
@@ -11,7 +11,7 @@
|
||||
{{/* Functionality located within filesaver.js The copy here is located in the css with .copy class so it can be replaced with JS on success */}}
|
||||
{{end}}
|
||||
<div class="code-copy-content nt3" {{with .Get "download"}}id="{{.}}"{{end}}>
|
||||
{{ if $isHTML }}{{- highlight .Inner "html" "" | -}}{{ else }}<pre><code>{{- .Inner | string -}}</code></pre>{{ end }}
|
||||
{{ if .Get "nocode" }}{{ .Inner }}{{ else }}{{ if $isHTML }}{{- highlight .Inner "html" "" | -}}{{ else }}<pre><code>{{- .Inner | string -}}</code></pre>{{ end }}{{ end }}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
@@ -1,6 +1,8 @@
|
||||
{{$file := .Get "file"}}
|
||||
{{- if eq (.Get "markdown") "true" -}}
|
||||
{{- $file | readFile | markdownify -}}
|
||||
{{- else if (.Get "highlight") -}}
|
||||
{{- highlight ($file | readFile) (.Get "highlight") "" -}}
|
||||
{{- else -}}
|
||||
{{ $file | readFile | safeHTML }}
|
||||
{{- end -}}
|
Reference in New Issue
Block a user