Fix/mila/toc from devportal (#361)

* table of contents styles upd

* TOC styles

* added GH links to the table of content, fixes

* removed obsolete code

* toc styles fixes
This commit is contained in:
trean
2023-10-20 21:11:24 +02:00
committed by GitHub
parent 66b1c5571a
commit 4e9023120a
6 changed files with 55 additions and 19 deletions
@@ -7,10 +7,5 @@
{{ .Content | replaceRE "(<table>(?:.|\n)+?</table>)" $wrappedTable | safeHTML }}
</article>
<div style="overflow: auto">
<span style="float: right">
<a href="{{ .Site.Params.githubDocPrefix }}{{ .File.Path }}" target="_blank">Edit on GitHub <i class="flaticon-github"></i></a>
</span>
</div>
</div>
{{ end }}
@@ -1,11 +1,24 @@
{{$currentNode := .}}
<nav class="tableOfContent col-lg-2 col-12 d-lg-block d-none mt-0 pr-4 mb-4">
{{ $sectionLink := cond .IsSection .RelPermalink .Parent.RelPermalink }}
{{ $subject := site.GetPage $sectionLink }}
{{ if gt (.TableOfContents | len) 34 }}
<div class="sticky-top">
<h5 class="tableOfContent__header">Table of contents</h5>
{{ .TableOfContents }}
<div class="divider mb-1"></div>
<ul class="tableOfContent__footer">
<li>
<a class="text-brand-p" href="{{ .Site.Params.githubDocPrefix }}{{ .File.Path }}" target="_blank">
<i class="fab fa-github"></i> Edit on GitHub
</a>
</li>
<li>
<a class="text-brand-p" href="{{ .Site.Params.githubIssueLink }}" target="_blank">
<i class="fa fa-bug"></i> Create an Issue
</a>
</li>
</ul>
<br/>
</div>
</nav>
{{ end }}
</nav>