Skip to content

Commit

Permalink
Merge pull request #2 from Nuklai/feat/algolia
Browse files Browse the repository at this point in the history
handle algolia and stuff
  • Loading branch information
Developerayo authored Sep 18, 2024
2 parents db3681e + 2fe55be commit 80e43c9
Show file tree
Hide file tree
Showing 11 changed files with 12,254 additions and 3,175 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
.env.development.local
.env.test.local
.env.production.local
.env

npm-debug.log*
yarn-debug.log*
Expand Down
42 changes: 42 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"index_name": "nuklai_docs",
"start_urls": ["https://docs.nukl.ai/", "http://localhost:3000/sitemap.xml"],
"sitemap_urls": ["http://localhost:3000/sitemap.xml"],
"allowed_domains": ["docs.nukl.ai"],
"stop_urls": ["#__docusaurus_skipToContent_fallback"],
"sitemap_alternate_links": true,
"selectors": {
"lvl0": {
"selector": "(//ul[contains(@class,'menu__list')]//a[contains(@class, 'menu__link menu__link--sublist menu__link--active')]/text() | //nav[contains(@class, 'navbar')]//a[contains(@class, 'navbar__link--active')]/text())[last()]",
"type": "xpath",
"global": true,
"default_value": "Documentation"
},
"lvl1": "article h1",
"lvl2": "article h2",
"lvl3": "article h3",
"lvl4": "article h4",
"lvl5": "article h5",
"text": "article p, article li"
},
"strip_chars": " .,;:#",
"custom_settings": {
"separatorsToIndex": "_",
"attributesForFaceting": ["language", "version", "type", "docusaurus_tag"],
"attributesToRetrieve": [
"hierarchy",
"content",
"anchor",
"url",
"url_without_anchor",
"type"
]
},
"js_render": true,
"js_wait": 25,
"max_concurrent_requests": 3,
"nb_retries": 5,
"use_anchors": false,
"selectors_exclude": [".hash-link"],
"min_indexed_level": 0
}
7 changes: 7 additions & 0 deletions do-cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
docker run --platform linux/amd64 -it --env-file=.env \
-e "CONFIG=$(cat config.json | jq -c)" \
-e "DEBUG=1" -e "LOG_LEVEL=DEBUG" -e "VERBOSE=1" \
algolia/docsearch-scraper:latest


# algolia sync
109 changes: 73 additions & 36 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
// See: https://docusaurus.io/docs/api/docusaurus-config

import {themes as prismThemes} from 'prism-react-renderer';
import dotenv from 'dotenv';

dotenv.config();

/** @type {import('@docusaurus/types').Config} */
const config = {
Expand Down Expand Up @@ -33,6 +36,13 @@ const config = {
defaultLocale: 'en',
locales: ['en'],
},
stylesheets: [
{
href: 'https://cdn.jsdelivr.net/npm/@docsearch/css@3',
type: 'text/css',
rel: 'stylesheet',
},
],

presets: [
[
Expand Down Expand Up @@ -64,6 +74,10 @@ const config = {
theme: {
customCss: './src/css/custom.css',
},
sitemap: {
changefreq: 'daily',
priority: 0.5,
},
}),
],
],
Expand All @@ -78,6 +92,13 @@ const config = {
disableSwitch: true,
respectPrefersColorScheme: false,
},
algolia: {
appId: process.env.ALGOLIA_APP_ID,
apiKey: process.env.ALGOLIA_API_KEY,
indexName: process.env.ALGOLIA_INDEX_NAME,
placeholder: 'Search xyz',
contextualSearch: true,
},
navbar: {
title: 'Nuklai Protocol',
logo: {
Expand All @@ -91,45 +112,61 @@ const config = {
position: 'left',
label: 'Docs',
},
{
type: 'search',
position: 'right',
},
// Coming back to this
// { to: '/blog', label: 'Blog', position: 'left' },
{ href: 'https://www.nukl.ai/about', label: 'About', position: 'right' },
{ href: 'https://app.nukl.ai/', label: 'Application', position: 'right' },
{ href: 'https://github.com/nuklai', label: 'GitHub', position: 'right' },
{
href: 'https://www.nukl.ai/about',
label: 'About',
position: 'right',
},
{
href: 'https://app.nukl.ai/',
label: 'Application',
position: 'right',
},
{
href: 'https://github.com/nuklai',
label: 'GitHub',
position: 'right',
},
],
},
metadata: [
{
name: 'keywords',
content:
'Nuklai, Data Marketplace, Blockchain, DeFi, AI, LLM, Avalanche, HyperSDK',
},
{
name: 'description',
content:
'Building lightning-fast VMs & on-chain dApps, empowering next-gen blockchain developers and AI Data scientists.',
},
{ name: 'twitter:card', content: 'summary_large_image' },
{ name: 'twitter:title', content: 'Nuklai Protocol Documentation' },
{
name: 'twitter:description',
content:
'Building lightning-fast VMs & on-chain dApps, empowering next-gen blockchain developers and AI Data scientists.',
},
{ name: 'twitter:image', content: '/img/banner.jpg' },
{ property: 'og:title', content: 'Nuklai Protocol Documentation' },
{
property: 'og:description',
content:
'Building lightning-fast VMs & on-chain dApps, empowering next-gen blockchain developers and AI Data scientists.',
},
{ property: 'og:url', content: 'https://docs.nukl.ai' },
{ property: 'og:type', content: 'website' },
{ property: 'og:image', content: '/img/banner.jpg' },
{ property: 'og:image:type', content: 'image/jpg' },
{ property: 'og:image:width', content: '1200' },
{ property: 'og:image:height', content: '630' },
],
metadata: [
{
name: 'keywords',
content:
'Nuklai, Data Marketplace, Blockchain, DeFi, AI, LLM, Avalanche, HyperSDK',
},
{
name: 'description',
content:
'Building lightning-fast VMs & on-chain dApps, empowering next-gen blockchain developers and AI Data scientists.',
},
{ name: 'twitter:card', content: 'summary_large_image' },
{ name: 'twitter:title', content: 'Nuklai Protocol Documentation' },
{
name: 'twitter:description',
content:
'Building lightning-fast VMs & on-chain dApps, empowering next-gen blockchain developers and AI Data scientists.',
},
{ name: 'twitter:image', content: '/img/banner.jpg' },
{ property: 'og:title', content: 'Nuklai Protocol Documentation' },
{
property: 'og:description',
content:
'Building lightning-fast VMs & on-chain dApps, empowering next-gen blockchain developers and AI Data scientists.',
},
{ property: 'og:url', content: 'https://docs.nukl.ai' },
{ property: 'og:type', content: 'website' },
{ property: 'og:image', content: '/img/banner.jpg' },
{ property: 'og:image:type', content: 'image/jpg' },
{ property: 'og:image:width', content: '1200' },
{ property: 'og:image:height', content: '630' },
],
// footer: {
// style: 'dark',
// links: [],
Expand All @@ -139,6 +176,6 @@ const config = {
darkTheme: prismThemes.dracula,
},
}),
};
}

export default config;
Loading

0 comments on commit 80e43c9

Please sign in to comment.