Add table of contents #4

Merged
realloc merged 7 commits from a.shamray/dot-hugo:feature/9-table-of-contents into frostfs_design_version 2023-05-29 14:50:52 +00:00
3 changed files with 22 additions and 6 deletions
Showing only changes of commit 53e601ad4b - Show all commits

View file

@ -82,6 +82,22 @@ h6,
font-size: 14px; font-size: 14px;
} }
#title {
font-size: 32px;
}
.content h2 {
font-size: 26px;
}
.content h3 {
font-size: 20px;
}
.content h4 {
font-size: 18px;
}
/* Button style */ /* Button style */
.btn { .btn {
font-size: 14px; font-size: 14px;
@ -621,9 +637,9 @@ textarea.form-control {
} }
/* this is so that the header does not overlap the section title */ /* this is so that the header does not overlap the section title */
.content h2:before,
.content h3:before, .content h3:before,
.content h4:before, .content h4:before {
.content h5:before {
display: block; display: block;
content: ""; content: "";
height: 75px; height: 75px;
@ -636,9 +652,9 @@ textarea.form-control {
margin-left: 10px; margin-left: 10px;
} }
.content h2:hover .title-link,
.content h3:hover .title-link, .content h3:hover .title-link,
.content h4:hover .title-link, .content h4:hover .title-link {
.content h5:hover .title-link {
opacity: 1; opacity: 1;
} }

View file

@ -129,7 +129,7 @@
// table of contents // table of contents
$('h3, h4, h5', '.content').each(function () { $('h2, h3, h4', '.content').each(function () {
$(this).append('<a class="title-link" href="#' + $(this).attr('id') + '">#</a>'); $(this).append('<a class="title-link" href="#' + $(this).attr('id') + '">#</a>');
}); });

View file

@ -30,7 +30,7 @@
</div> </div>
<div class="col-lg-8"> <div class="col-lg-8">
<div class="p-lg-5 p-4 bg-white" id="content"> <div class="p-lg-5 p-4 bg-white" id="content">
<h2 class="mb-5" id="title">{{ partial "title.html" . }}</h2> <h1 class="mb-5" id="title">{{ partial "title.html" . }}</h1>
{{ if .Content }} {{ if .Content }}
<div class="content"> <div class="content">
{{ if isset .Params "status" }} {{ if isset .Params "status" }}