Added comments+ EXPOSE publishDate if available, under mentions
This commit is contained in:
parent
cfc466f904
commit
be0e2905b4
1 changed files with 23 additions and 3 deletions
|
@ -12,24 +12,29 @@
|
|||
{{ $sandnameSingular := "" }}
|
||||
{{ $mentionLink := "" }}
|
||||
|
||||
<!-- TITLE -->
|
||||
<div class="{{ $scratch.depth | default "crust" }}title"><span class="supt">{{ substr $currentDir 0 -1 }}⁄</span>{{ .Title }}</div>
|
||||
|
||||
<div class="grid">
|
||||
<!-- TOC -->
|
||||
<div class="leftcolumn">
|
||||
{{ if ne (trim .Page.TableOfContents "\n") "<nav id=\"TableOfContents\"></nav>" }}
|
||||
{{ .Page.TableOfContents }}
|
||||
{{ end }}
|
||||
</div>
|
||||
<!-- RIGHT COLUMN -->
|
||||
<div class="rightcolumn">
|
||||
{{ $closeDivs := false }}
|
||||
|
||||
<!-- Get plurals from JSON Dictionary of item types -->
|
||||
{{ range $k, $v := $.Site.Data.sandpointsnamegraph }}
|
||||
{{ $sandnamePlural = $sandnamePlural | append $v }}
|
||||
{{ end }}
|
||||
{{ $paramsKeys := (slice) }}
|
||||
<!-- Loop Params -->
|
||||
{{ range $k, $v := $currentNode.Params }}
|
||||
{{ $paramsKeys = $paramsKeys | append $k }}
|
||||
{{ end }}
|
||||
<!-- Loop Mentions -->
|
||||
{{ $mentions := intersect $paramsKeys $sandnamePlural }}
|
||||
{{ range $mention := $mentions }}
|
||||
{{ range $k, $m := index $currentNode.Params $mention }}
|
||||
|
@ -39,6 +44,7 @@
|
|||
{{ $sandnameSingular = $k }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
<!-- Format mention links-->
|
||||
{{- with $.GetPage $mentionLink -}}
|
||||
{{- with not $k -}}
|
||||
{{ $closeDivs = true }}
|
||||
|
@ -53,7 +59,7 @@
|
|||
{{ end }}
|
||||
{{- with $closeDivs -}}</div></div>{{ end }}
|
||||
{{ end }}
|
||||
|
||||
<!-- MENTIONED IN -->
|
||||
{{ if in .Page.Site.Params.sandpointsMentionedIn (substr $currentDir 0 -1) }}
|
||||
<div class="has hasmentionedin">
|
||||
{{ with $scratch.backlinks }}
|
||||
|
@ -68,6 +74,7 @@
|
|||
</div></div>
|
||||
{{ end }}
|
||||
|
||||
<!-- CHILDREN (HAS) -->
|
||||
{{ if and (not (eq $scratch.depth "crust")) $scratch.has_children }}
|
||||
<div class="has hashas">
|
||||
{{ with $scratch.has }}
|
||||
|
@ -81,6 +88,7 @@
|
|||
{{ end }}
|
||||
</div></div>
|
||||
{{ end }}
|
||||
|
||||
|
||||
{{ if eq $scratch.depth "crust" }}
|
||||
<div class="has hasin">
|
||||
|
@ -93,13 +101,25 @@
|
|||
{{ end }}
|
||||
</div></div>
|
||||
{{ end }}
|
||||
|
||||
<!-- EDIT: ADD PUBLISH DATE IF ITs AVAILABLE-->
|
||||
{{ if .Page.Params.publishDate }}
|
||||
<div class= "haspublishdate"> Published on {{ .Page.Params.publishDate.Format "Jan, 2 2006" }} </div>
|
||||
{{ end }}
|
||||
|
||||
<!-- end of right column-->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
{{ with .Page.Params.abstract }}<div class="abstract"><span class="supt">abstract⁄</span>{{ . | $.Page.RenderString | htmlUnescape | safeHTML }}</div>{{ end }}
|
||||
|
||||
<!-- ABSTRACT -->
|
||||
{{ with .Page.Params.abstract }}<div class="abstract"><span class="supt">abstract⁄</span>{{ . | $.Page.RenderString | htmlUnescape | safeHTML }}</div>{{ end }}
|
||||
<!-- KEYWORDS -->
|
||||
{{- $vld := false -}}{{- range $k, $v := .Page.Params.keywords -}}{{- if eq $k 0 -}}{{- $vld = true -}}<div class="keywords"><span class="sup">keywords⁄</span><a href="/keywords/{{ urlize $v }}/{{ if eq hugo.Environment "offline" }}index.html{{ end }}">{{- $v -}}</a>{{- else -}}, <a href="/keywords/{{ urlize $v }}/{{ if eq hugo.Environment "offline" }}index.html{{ end }}">{{- $v -}}</a>{{- end -}}{{- end -}}{{- with $vld -}}</div>{{- end -}}
|
||||
|
||||
<!-- CONTENT -->
|
||||
{{ $var := printf "repo={\"frontmatter\": %s, \"content\": %s, \"path\": \"%s\", \"relpermalink\": \"%s\" }" (jsonify .Params) (jsonify .RawContent) .File.Path .RelPermalink | resources.FromString (printf "js/repo/%s.js" .File.UniqueID) }}
|
||||
{{ $dummy := $var.Permalink }}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue