Skip to content

Commit bd1fde9

Browse files
authored
Merge branch 'master' into edit-url-text
2 parents 822dae3 + 251f2d1 commit bd1fde9

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
lines changed

preview-src/tables.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
// :page-edit-url-body: Custom raise an issue body text
66
// :page-edit-url-title: Custom raise an issue title text
77
:page-edit-url-uri: https://github.com/neo4j/docs-cypher/blob/dev/modules/ROOT/pages/queries/index.adoc
8+
:page-custom-canonical: https://neo4j.com/docs/cypher-manual/current/clauses/where/
89

910
.No striping
1011
// Alternative to stripes attributes is

src/js/02-on-this-page.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@
3232
var menu = sidebar.querySelector('.toc-menu-placeholder')
3333
if (!menu) (menu = document.createElement('div')).className = 'toc-menu-placeholder'
3434

35+
if (document.querySelector('body.has-banner')) {
36+
document.querySelector('.toc-menu').style.top = 'calc(var(--toc-top) + var(--banner-height))'
37+
}
38+
3539
var title = document.createElement('h2')
3640
title.textContent = sidebar.dataset.title || 'Contents'
3741
menu.appendChild(title)
@@ -87,7 +91,8 @@
8791
if (lastActiveFragment) links[lastActiveFragment].classList.remove('is-active')
8892
var activeLink = links[activeFragment]
8993
activeLink.classList.add('is-active')
90-
if (list.scrollHeight > list.offsetHeight) {
94+
// don't scroll page contents if cheat-sheet
95+
if (list.scrollHeight > list.offsetHeight && !document.querySelector('body.cheat-sheet')) {
9196
list.scrollTop = Math.max(0, activeLink.offsetTop + activeLink.offsetHeight - list.offsetHeight)
9297
}
9398
lastActiveFragment = activeFragment

src/js/12-fragment-jumper.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@
3333
var scrollTarget = this.closest('div')
3434
var selectorsTop = document.querySelector('.nav-container .selectors').querySelector('div').getBoundingClientRect().top
3535
if (this.tagName === 'H3') topOffset = selectorsTop
36-
window.scrollTo(0, computePosition(scrollTarget, 0) - topOffset)
36+
window.scrollTo(0, computePosition(scrollTarget, 0) - (topOffset + 20))
3737
} else {
38-
window.scrollTo(0, computePosition(target, 0) - topOffset)
38+
window.scrollTo(0, computePosition(target, 0) - (topOffset + 20))
3939
}
4040
}
4141

src/partials/head-info.hbs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,14 @@
33
<link rel="canonical" href="{{{this}}}">
44
{{/with}}
55
{{else}}
6+
{{#if page.attributes.custom-canonical}}
7+
{{#with page.attributes.custom-canonical}}
8+
<link rel="canonical" href="{{{this}}}">
9+
{{/with}}
10+
{{else}}
611
<link rel="canonical" href="https://neo4j.com{{{ page.attributes.canonical-root }}}{{ page.url }}">
712
{{/if}}
13+
{{/if}}
814

915
{{#unless (eq page.attributes.pagination undefined)}}
1016
{{#with page.previous}}

0 commit comments

Comments
 (0)