diff options
Diffstat (limited to 'themes/default/layouts/_default/single.html')
-rw-r--r-- | themes/default/layouts/_default/single.html | 124 |
1 files changed, 61 insertions, 63 deletions
diff --git a/themes/default/layouts/_default/single.html b/themes/default/layouts/_default/single.html index 9aeb728..8a6444d 100644 --- a/themes/default/layouts/_default/single.html +++ b/themes/default/layouts/_default/single.html @@ -5,79 +5,77 @@ {{- end -}} {{- define "middle" -}} + {{- partial "navigator-middle.html" + (dict + "Title" "Message" + "Subtitle" "Thread" + "Icon" "arrow-left" + "IconLabel" "Back" + "Href" "/" + "Id" "back" + "Context" . + ) + -}} -{{- partial "navigator-middle.html" - (dict - "Title" "Message" - "Subtitle" "Thread" - "Icon" "arrow-left" - "IconLabel" "Back" - "Href" "/" - "Id" "back" - "Context" . - ) --}} + <micro-thread> + {{- partial "render-embed.html" . -}} -<micro-thread> - {{ .Render "summary" }} + {{- $nextHref := "" -}} + {{- $prevHref := "" -}} + {{- $nextTitle := "" -}} + {{- $prevTitle := "" -}} + {{- $nextInvisible := "data-invisible" -}} + {{- $prevInvisible := "data-invisible" -}} - {{- $nextHref := "" -}} - {{- $prevHref := "" -}} - {{- $nextTitle := "" -}} - {{- $prevTitle := "" -}} - {{- $nextInvisible := "data-invisible" -}} - {{- $prevInvisible := "data-invisible" -}} + {{- with .Next -}} + {{- $nextHref = $.Next.Permalink -}} + {{- $nextTitle = $.Next.Summary -}} + {{- $nextInvisible = "" -}} + {{- end -}} - {{- with .Next -}} - {{- $nextHref = $.Next.Permalink -}} - {{- $nextTitle = $.Next.Summary -}} - {{- $nextInvisible = "" -}} - {{- end -}} + {{- with .Prev -}} + {{- $prevHref = $.Prev.Permalink -}} + {{- $prevTitle = $.Prev.Summary -}} + {{- $prevInvisible = "" -}} + {{- end -}} - {{- with .Prev -}} - {{- $prevHref = $.Prev.Permalink -}} - {{- $prevTitle = $.Prev.Summary -}} - {{- $prevInvisible = "" -}} - {{- end -}} + {{- with or .Next .Prev -}} + <paginator-navigation> + <a {{ $nextInvisible | safeHTMLAttr }} href="{{ $nextHref }}" title="{{ $nextTitle }}"> + {{ safeHTML (readFile (print (partial "function-paths.html").static "/icons/feather/arrow-left.svg")) }} + Newer + </a> - {{- with or .Next .Prev -}} - <paginator-navigation> - <a {{ $nextInvisible | safeHTMLAttr }} href="{{ $nextHref }}" title="{{ $nextTitle }}"> - {{ safeHTML (readFile (print (partial "function-paths.html").static "/icons/feather/arrow-left.svg")) }} - Newer - </a> + <a {{ $prevInvisible | safeHTMLAttr }} href="{{ $prevHref }}" title="{{ $prevTitle }}"> + Older + {{ safeHTML (readFile (print (partial "function-paths.html").static "/icons/feather/arrow-right.svg")) }} + </a> + </paginator-navigation> + {{- end -}} - <a {{ $prevInvisible | safeHTMLAttr }} href="{{ $prevHref }}" title="{{ $prevTitle }}"> - Older - {{ safeHTML (readFile (print (partial "function-paths.html").static "/icons/feather/arrow-right.svg")) }} - </a> - </paginator-navigation> - {{- end -}} + {{- $filteredPages := partial "function-filters-content.html" (.Site.RegularPages.Related .) -}} + {{- $related := $filteredPages | first 3 -}} - {{- $filteredPages := partial "function-filters-content.html" (.Site.RegularPages.Related .) -}} - {{- $related := $filteredPages | first 3 -}} - - {{- with $related -}} - <related-content> - <footer> - <samp> - Related Tags - {{- with $.Params.tags -}} - {{- range $tag := first 1 $.Params.tags -}} - {{- $link := print ("tags/" | relURL) ($tag | urlize) "/" }} - {{ print "---" " " "[#" $tag "](" $link ")" | markdownify -}} + {{- with $related -}} + <related-content> + <footer> + <samp> + Related Tags + {{- with $.Params.tags -}} + {{- range $tag := first 1 $.Params.tags -}} + {{- $link := print ("tags/" | relURL) ($tag | urlize) "/" }} + {{ print "---" " " "[#" $tag "](" $link ")" | markdownify -}} + {{- end -}} {{- end -}} - {{- end -}} - </samp> - </footer> - </related-content> - - {{- range $related -}} - {{- .Render "summary" -}} - {{- end -}} - {{- end -}} + </samp> + </footer> + </related-content> -</micro-thread> + {{- range $related -}} + {{- partial "render-embed.html" . -}} + {{- end -}} + {{- end -}} + </micro-thread> {{- end -}} {{- define "right" -}} |