-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add ToC on the guides section (#914)
* feat: add toc on the guides section * fix: adjust responsive padding [sc-17693] * fix: add container to avoid larger content [sc-17693] * fix: add fixed sidebar [sc-17693] * fix: scroll on toc [sc-17693] * fix: remove comment [sc-17693] --------- Co-authored-by: Stefan Judis <[email protected]>
- Loading branch information
1 parent
d26ab43
commit c402b72
Showing
4 changed files
with
204 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,27 @@ | ||
{{ define "main" }} | ||
<div class="main container guides"> | ||
<div class="row"> | ||
<div class="col-sm-12 col-lg-10 offset-lg-1"> | ||
<div class="d-flex container-fluid guides"> | ||
<div class="guides-page"> | ||
<div class="col-sm-12 col-lg-11"> | ||
<div class="guides__label"> | ||
Checkly Guides | ||
</div> | ||
<h1 class="guides__title">{{.Title}}</h1> | ||
<div class="guides-toc-mobile mb-5 pt-3"> | ||
<div class="guides-toc-header mb-3 pt-3">On this page</div> | ||
{{ .Page.TableOfContents }} | ||
</div> | ||
{{ if .Description }} | ||
<p class="guides__description">{{.Description}}</p> | ||
{{ end }} | ||
<span class="markdown">{{.Content}}</span> | ||
</div> | ||
{{ partial "start-for-free-row" . }} | ||
</div> | ||
{{ partial "start-for-free-row" . }} | ||
<aside class="guides-toc mb-3"> | ||
<div id="tocMenu"> | ||
<div class="guides-toc-header">On this page</div> | ||
{{ .Page.TableOfContents }} | ||
</div> | ||
</aside> | ||
</div> | ||
{{end}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/** | ||
* Docs TOC Sidebar | ||
*/ | ||
|
||
const sideMenuDistance = $('#tocMenu').offset().top - 10 | ||
|
||
$(window).on('scroll', function () { | ||
if ($(window).scrollTop() >= sideMenuDistance) { | ||
$('#tocMenu').css({ | ||
position: 'fixed', | ||
top: '30px' | ||
}) | ||
} else { | ||
$('#tocMenu').css({ | ||
position: 'relative', | ||
top: '0' | ||
}) | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
c402b72
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
checklyhq-com – ./
checklyhq-com.vercel.app
checklyhq-com-git-main-checkly.vercel.app
checklyhq-com-checkly.vercel.app
docs.checklyhq.com
docs-learn-guides-checklyhq.vercel.app