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
+1
View File
@@ -72,6 +72,7 @@ keywords = "search engine, vector database, neural network, matching, filter, Sa
gdpr = "We use cookies to learn more about you. At any time you can delete or block cookies through your browser settings." gdpr = "We use cookies to learn more about you. At any time you can delete or block cookies through your browser settings."
githubDocPrefix = "https://github.com/qdrant/landing_page/tree/master/qdrant-landing/content/" githubDocPrefix = "https://github.com/qdrant/landing_page/tree/master/qdrant-landing/content/"
githubIssueLink = "https://github.com/qdrant/landing_page/issues/new/choose"
docVersion = "v1.4.x" docVersion = "v1.4.x"
cloudDocVersion = "v0.1.x" cloudDocVersion = "v0.1.x"
@@ -7,10 +7,5 @@
{{ .Content | replaceRE "(<table>(?:.|\n)+?</table>)" $wrappedTable | safeHTML }} {{ .Content | replaceRE "(<table>(?:.|\n)+?</table>)" $wrappedTable | safeHTML }}
</article> </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> </div>
{{ end }} {{ end }}
@@ -1,11 +1,24 @@
{{$currentNode := .}} {{$currentNode := .}}
<nav class="tableOfContent col-lg-2 col-12 d-lg-block d-none mt-0 pr-4 mb-4"> <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 }} {{ if gt (.TableOfContents | len) 34 }}
{{ $subject := site.GetPage $sectionLink }}
<div class="sticky-top"> <div class="sticky-top">
<h5 class="tableOfContent__header">Table of contents</h5> <h5 class="tableOfContent__header">Table of contents</h5>
{{ .TableOfContents }} {{ .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/> <br/>
</div> </div>
</nav> {{ end }}
</nav>
@@ -1,29 +1,46 @@
@use "../helpers/functions" as lib;
.tableOfContent { .tableOfContent {
top: 0; top: 10px;
right: 0; right: 0;
font-size: lib.rem(14);
&__header { &__header {
margin-bottom: 0.8rem; font-size: 1rem;
margin-bottom: lib.rem(13);
margin-left: -5px; margin-left: -5px;
} }
& ul { & nav {
margin: 0; margin-bottom: lib.rem(10);
& ul {
margin: 0;
padding: 0;
}
} }
& ul li { & ul li {
padding-left: 0;
list-style: none; list-style: none;
line-height: lib.rem(18);
margin: 0; margin: 0;
&:not(nav > ul > li) {
list-style: '· '; &:not(nav > ul > li):not(ul.tableOfContent__footer > li) {
margin-left: 0.5rem; padding-left: 1rem;
} }
} }
& a { & a {
display: inline-block;
padding: 6px 0;
&:hover {
text-decoration: underline;
}
}
& ul:not(.tableOfContent__footer) a {
display: block; display: block;
line-height: 2.2;
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
@@ -31,7 +48,13 @@
&:hover { &:hover {
color: var(--brand-primary); color: var(--brand-primary);
text-decoration: underline; }
}
&__footer {
margin-top: lib.rem(10);
li {
padding-left: 0;
} }
} }
} }
File diff suppressed because one or more lines are too long
@@ -147,6 +147,10 @@ blockquote {
font-style: italic; font-style: italic;
} }
.divider {
border-bottom: 1px solid var(--brand-mid-grey);
}
.marquee { .marquee {
@include marquee.base(80px, 200px, 13, 6, 20px, false, 50s); @include marquee.base(80px, 200px, 13, 6, 20px, false, 50s);
} }