Skip to content

Commit

Permalink
feat(docs): algolia -> typesense (#9698)
Browse files Browse the repository at this point in the history
  • Loading branch information
catmcgee authored Jan 2, 2025
1 parent 4dca8f5 commit e082063
Show file tree
Hide file tree
Showing 6 changed files with 4,115 additions and 868 deletions.
12 changes: 6 additions & 6 deletions docs/HOW_WE_WRITE_DOCS.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# How we write docs

This doc covers the structure and tone of Aztec developer documentation. For the contribution guidelines, go [here](./CONTRIBUTING.md). Please keep in mind that this is constantly changing.
This doc covers the structure and tone of Aztec developer documentation. For the contribution guidelines, go [here](./CONTRIBUTING.md). Please keep in mind that this is constantly changing.

## Structure

### High level

Aztec docs are divided into two main sections - `Learn` and `Build`.
Aztec docs are divided into two main sections - `Learn` and `Build`.

Anyone technical can read the `Learn` section, whereas only developers who are actively building or starting to build on Aztec will read the `Build` section.

Expand All @@ -16,7 +16,7 @@ The `Build` section contains information that only developers need to know - thi

### Types of pages

The Aztec docs roughly follow the [Diataxis](https://diataxis.fr/) framework. It is recommended to read this website before contributing to the docs.
The Aztec docs roughly follow the [Diataxis](https://diataxis.fr/) framework. It is recommended to read this website before contributing to the docs.

Every page will fall into **one type of doc**. If your contribution covers multiple types, you will need to split it into multiple pages.

Expand All @@ -39,8 +39,8 @@ These are docs that developers can consult to know exact and succinct informatio
## Tone

* Concise and informative - for example, rather than repeating information, write "to learn more, read ..."
* Friendly and empathetic - for example, "you do not have to worry about this yet"
* Simple and jardon-avoidant when possible
* Friendly and empathetic - for example, "you do not have to worry about this yet"
* Simple and jardon-avoidant when possible
* Short sentences
* Unopinionated language - we know things are exciting sometimes, but try not to tell the developer what they should be excited about

Expand Down Expand Up @@ -85,4 +85,4 @@ The Aztec docs use a sidebar - https://docusaurus.io/docs/sidebar/items

## Indexing and Search

Algolia docs search - https://docusaurus.io/docs/search#algolia-index-configuration
Typesense docs search - https://typesense.org/
21 changes: 13 additions & 8 deletions docs/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const config = {
markdown: {
mermaid: true,
},
themes: ["@docusaurus/theme-mermaid"],
themes: ["@docusaurus/theme-mermaid", "docusaurus-theme-search-typesense"],
presets: [
[
"@docusaurus/preset-classic",
Expand Down Expand Up @@ -193,14 +193,19 @@ const config = {
},
],
image: "img/docs-preview-image.png",
algolia: {
appId: "CL4NK79B0W",
apiKey: "21d89dadaa37a4d1b6bf4b17978dcf7f",
indexName: "aztec",
typesense: {
typesenseCollectionName: "aztec-docs",
typesenseServerConfig: {
nodes: [
{
host: "cpk69vuom0ilr4abp.a1.typesense.net",
port: 443,
protocol: "https",
},
],
apiKey: "gpH8o2YnqsOEj2jgtIMTULbtHi1kZ2X3", // public search-only api key, safe to commit
},
contextualSearch: true,
customRanking: [
{ asc: 'importance' },
],
},
colorMode: {
defaultMode: "light",
Expand Down
15 changes: 8 additions & 7 deletions docs/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "my-website",
"name": "aztec-docs",
"version": "0.0.0",
"private": true,
"scripts": {
Expand All @@ -17,14 +17,15 @@
},
"dependencies": {
"@cookbookdev/docsbot": "^4.21.12",
"@docusaurus/core": "^3.0.1",
"@docusaurus/plugin-ideal-image": "^3.0.1",
"@docusaurus/preset-classic": "^3.0.1",
"@docusaurus/theme-mermaid": "^3.0.1",
"@docusaurus/core": "^3.6.3",
"@docusaurus/plugin-ideal-image": "^3.6.3",
"@docusaurus/preset-classic": "^3.6.3",
"@docusaurus/theme-mermaid": "^3.6.3",
"@mdx-js/react": "^3.0.1",
"@slorber/react-ideal-image": "^0.0.12",
"axios": "^1.4.0",
"clsx": "^1.1.1",
"docusaurus-theme-search-typesense": "0.23.0-0",
"hast-util-is-element": "1.1.0",
"prism-react-renderer": "^2.1.0",
"prop-types": "^15.8.1",
Expand All @@ -38,8 +39,8 @@
"sharp": "^0.33.3"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "^3.0.1",
"@docusaurus/types": "3.0.0",
"@docusaurus/module-type-aliases": "^3.6.3",
"@docusaurus/types": "^3.6.3",
"@tsconfig/docusaurus": "^1.0.5",
"@types/prop-types": "^15",
"concurrently": "^8.0.1",
Expand Down
47 changes: 47 additions & 0 deletions docs/typesense.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"index_name": "aztec-docs",
"start_urls": [
"https://docs.aztec.network/"
],
"sitemap_urls": [
"https://docs.aztec.network/sitemap.xml"
],
"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": "header h1",
"lvl2": "header h2",
"lvl3": "header h3",
"lvl4": "header h4",
"lvl5": "header h5",
"lvl6": "header h6",
"text": "article p, article li, article td:last-child"
},
"strip_chars": " .,;:#",
"custom_settings": {
"separatorsToIndex": "_",
"attributesForFaceting": [
"language",
"version",
"type",
"docusaurus_tag"
],
"attributesToRetrieve": [
"hierarchy",
"content",
"anchor",
"url",
"url_without_anchor",
"type"
]
},
"conversation_id": [
"833762294"
],
"nb_hits": 46250
}
Loading

0 comments on commit e082063

Please sign in to comment.