Skip to content

Commit f732281

Browse files
add page-chatbot attribute to enable chatbot (#252)
The `page-chatbot` attribute sets the base URL of the folder containing the HTML and CSS built by the docs-chatbot repo. ``` :page-chatbot: https://neo4j.com/static/chatbot/ ``` A PR to sync the js/css assets has been opened at: neo4j/docs-chatbot#8 --------- Co-authored-by: Neil Dewhurst <[email protected]>
1 parent 37970c7 commit f732281

File tree

5 files changed

+26
-4
lines changed

5 files changed

+26
-4
lines changed

preview-src/driver.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
= Neo4j & Python
22
:page-theme: docs
33
:page-role: code-walkthrough
4+
:page-chatbot: http://localhost:3000
45
:!toc:
56

67

src/css/base.css

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
html,
22
body {
3-
height: 100%;
3+
height: fit-content;
44
}
55

66
*,
@@ -29,6 +29,11 @@ body {
2929
margin: 0;
3030
}
3131

32+
h1,
33+
h2 {
34+
font-family: var(--body-font-family);
35+
}
36+
3237
a {
3338
text-decoration: none;
3439
}

src/css/neo4j-docs.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
/* chatbot */
2+
.docs .ndl-drawer.ndl-drawer-overlay {
3+
position: fixed;
4+
top: 4px;
5+
box-shadow: -2px 1px 2px 1px rgba(var(--colors-neutral-20));
6+
}
7+
18
.doc .paragraph .title {
29
font-weight: var(--body-font-weight-bold);
310
}

src/partials/footer-scripts.hbs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
{{/if}}
1111
{{#if (and (eq @root.page.attributes.theme "cheat-sheet") @root.page.attributes.publish)}}
1212
<script src="{{{@root.site.path}}}{{{@root.site.ui.url}}}/js/vendor/auth0.js"></script>
13-
13+
1414
<script src="{{{@root.site.path}}}{{{@root.site.ui.url}}}/js/site.js"></script>
1515
{{!-- <script async src="{{{@root.site.path}}}{{{@root.site.ui.url}}}/js/vendor/gram.js"></script> --}}
1616
<script async src="{{{@root.site.path}}}{{{@root.site.ui.url}}}/js/vendor/highlight.js"></script>
@@ -28,7 +28,12 @@
2828
<script src="https://cdn.jsdelivr.net/npm/[email protected]/lib/browser/neo4j-web.min.js"></script>
2929
{{/if}}
3030

31+
{{#if page.attributes.chatbot}}
32+
<div id="docs_chatbot"></div>
33+
<script type="module" crossorigin src="{{{ page.attributes.chatbot }}}/index.js"></script>
34+
{{/if}}
35+
3136
<div id="neo4j-algolia-search-v2"></div>
3237
<script src="https://neo4j.com/wp-content/themes/neo4jweb/assets/neo4j-react-modules-assets/search-preact/chunkless/bundle.js"></script>
3338
<script src="https://neo4j.com/wp-content/themes/neo4jweb/assets/neo4j-react-modules-assets/search-preact/chunkless/polyfill.js"></script>
34-
<script>window.algoliaSearchOptions = {indexName: "docs",placeholder: "Search Documentation",template: "docs"}</script>
39+
<script>window.algoliaSearchOptions = {indexName: "docs",placeholder: "Search Documentation",template: "docs"}</script>

src/partials/head-styles.hbs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
<link rel="stylesheet" href="https://neo4j.com/wp-content/themes/neo4jweb/assets/neo4j-react-modules-assets/search-preact/chunkless/bundle.css" />
22
<link rel="stylesheet" href="https://neo4j.com/wp-content/themes/neo4jweb/assets/neo4j-react-modules-assets/search-preact/chunkless/utilities.min.css" />
33

4+
5+
{{#if page.attributes.chatbot}}
6+
<link rel="stylesheet" crossorigin href="{{{ page.attributes.chatbot }}}/index.css">
7+
{{/if}}
8+
49
{{#if page.attributes.cdn}}
510
<link rel="preload" href="{{{page.attributes.cdn}}}/fonts/fontawesome-webfont.woff2?v=4.7.0" as="font">
611
<link rel="stylesheet" href="{{{page.attributes.cdn}}}/css/site.css">
@@ -18,4 +23,3 @@
1823
<link href="https://fonts.googleapis.com/css2?family=Public+Sans:wght@300;400;500;600;700&display=swap" rel="stylesheet">
1924

2025
<link rel="shortcut icon" href="https://neo4j.com/wp-content/themes/neo4jweb/favicon.ico" />
21-

0 commit comments

Comments
 (0)