diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-02-21 10:02:51 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-02-21 10:02:51 +0100 |
commit | 4560261b58bae36316c525a43fee1e027705e92b (patch) | |
tree | 7ccac5ee434f3a18d11a934137f43dd07d617893 /docs/layouts | |
parent | 772128485a7e94932cd18b5e3a78d8cfb273e797 (diff) | |
parent | 374d184e6747678364fd61f5faf328ec9205eb6b (diff) |
Merge commit '374d184e6747678364fd61f5faf328ec9205eb6b'
Diffstat (limited to 'docs/layouts')
-rw-r--r-- | docs/layouts/maintenance/list.html | 36 | ||||
-rw-r--r-- | docs/layouts/partials/maintenance-pages-table.html | 24 | ||||
-rw-r--r-- | docs/layouts/shortcodes/code.html | 2 | ||||
-rw-r--r-- | docs/layouts/shortcodes/readfile.html | 2 |
4 files changed, 63 insertions, 1 deletions
diff --git a/docs/layouts/maintenance/list.html b/docs/layouts/maintenance/list.html new file mode 100644 index 000000000..50059ad9e --- /dev/null +++ b/docs/layouts/maintenance/list.html @@ -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 }}
\ No newline at end of file diff --git a/docs/layouts/partials/maintenance-pages-table.html b/docs/layouts/partials/maintenance-pages-table.html new file mode 100644 index 000000000..a29f0405c --- /dev/null +++ b/docs/layouts/partials/maintenance-pages-table.html @@ -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>
\ No newline at end of file diff --git a/docs/layouts/shortcodes/code.html b/docs/layouts/shortcodes/code.html index f40cf071d..4c12b0f29 100644 --- a/docs/layouts/shortcodes/code.html +++ b/docs/layouts/shortcodes/code.html @@ -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> diff --git a/docs/layouts/shortcodes/readfile.html b/docs/layouts/shortcodes/readfile.html index f777abe26..36400ac55 100644 --- a/docs/layouts/shortcodes/readfile.html +++ b/docs/layouts/shortcodes/readfile.html @@ -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 -}}
\ No newline at end of file |