Skip to content

Commit

Permalink
add page-chatbot attribute to enable chatbot (#252)
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
adam-cowley and recrwplay authored Aug 22, 2024
1 parent 37970c7 commit f732281
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 4 deletions.
1 change: 1 addition & 0 deletions preview-src/driver.adoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
= Neo4j & Python
:page-theme: docs
:page-role: code-walkthrough
:page-chatbot: http://localhost:3000
:!toc:


Expand Down
7 changes: 6 additions & 1 deletion src/css/base.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
html,
body {
height: 100%;
height: fit-content;
}

*,
Expand Down Expand Up @@ -29,6 +29,11 @@ body {
margin: 0;
}

h1,
h2 {
font-family: var(--body-font-family);
}

a {
text-decoration: none;
}
Expand Down
7 changes: 7 additions & 0 deletions src/css/neo4j-docs.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/* chatbot */
.docs .ndl-drawer.ndl-drawer-overlay {
position: fixed;
top: 4px;
box-shadow: -2px 1px 2px 1px rgba(var(--colors-neutral-20));
}

.doc .paragraph .title {
font-weight: var(--body-font-weight-bold);
}
Expand Down
9 changes: 7 additions & 2 deletions src/partials/footer-scripts.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{{/if}}
{{#if (and (eq @root.page.attributes.theme "cheat-sheet") @root.page.attributes.publish)}}
<script src="{{{@root.site.path}}}{{{@root.site.ui.url}}}/js/vendor/auth0.js"></script>

<script src="{{{@root.site.path}}}{{{@root.site.ui.url}}}/js/site.js"></script>
{{!-- <script async src="{{{@root.site.path}}}{{{@root.site.ui.url}}}/js/vendor/gram.js"></script> --}}
<script async src="{{{@root.site.path}}}{{{@root.site.ui.url}}}/js/vendor/highlight.js"></script>
Expand All @@ -28,7 +28,12 @@
<script src="https://cdn.jsdelivr.net/npm/[email protected]/lib/browser/neo4j-web.min.js"></script>
{{/if}}

{{#if page.attributes.chatbot}}
<div id="docs_chatbot"></div>
<script type="module" crossorigin src="{{{ page.attributes.chatbot }}}/index.js"></script>
{{/if}}

<div id="neo4j-algolia-search-v2"></div>
<script src="https://neo4j.com/wp-content/themes/neo4jweb/assets/neo4j-react-modules-assets/search-preact/chunkless/bundle.js"></script>
<script src="https://neo4j.com/wp-content/themes/neo4jweb/assets/neo4j-react-modules-assets/search-preact/chunkless/polyfill.js"></script>
<script>window.algoliaSearchOptions = {indexName: "docs",placeholder: "Search Documentation",template: "docs"}</script>
<script>window.algoliaSearchOptions = {indexName: "docs",placeholder: "Search Documentation",template: "docs"}</script>
6 changes: 5 additions & 1 deletion src/partials/head-styles.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
<link rel="stylesheet" href="https://neo4j.com/wp-content/themes/neo4jweb/assets/neo4j-react-modules-assets/search-preact/chunkless/bundle.css" />
<link rel="stylesheet" href="https://neo4j.com/wp-content/themes/neo4jweb/assets/neo4j-react-modules-assets/search-preact/chunkless/utilities.min.css" />


{{#if page.attributes.chatbot}}
<link rel="stylesheet" crossorigin href="{{{ page.attributes.chatbot }}}/index.css">
{{/if}}

{{#if page.attributes.cdn}}
<link rel="preload" href="{{{page.attributes.cdn}}}/fonts/fontawesome-webfont.woff2?v=4.7.0" as="font">
<link rel="stylesheet" href="{{{page.attributes.cdn}}}/css/site.css">
Expand All @@ -18,4 +23,3 @@
<link href="https://fonts.googleapis.com/css2?family=Public+Sans:wght@300;400;500;600;700&display=swap" rel="stylesheet">

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

0 comments on commit f732281

Please sign in to comment.