Skip to content

Commit 2a66cc9

Browse files
committed
switch to vitepress
1 parent f68a880 commit 2a66cc9

File tree

492 files changed

+3518
-789
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

492 files changed

+3518
-789
lines changed

.gitignore

+121-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,123 @@
1-
# Ignore compiled books
2-
book/
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
lerna-debug.log*
8+
.pnpm-debug.log*
39

4-
# Ignoring .DS_Store
5-
.DS_Store
10+
# Diagnostic reports (https://nodejs.org/api/report.html)
11+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
612

7-
# Temp files
8-
*~
13+
# Runtime data
14+
pids
15+
*.pid
16+
*.seed
17+
*.pid.lock
18+
19+
# Directory for instrumented libs generated by jscoverage/JSCover
20+
lib-cov
21+
22+
# Coverage directory used by tools like istanbul
23+
coverage
24+
*.lcov
25+
26+
# nyc test coverage
27+
.nyc_output
28+
29+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
30+
.grunt
31+
32+
# Bower dependency directory (https://bower.io/)
33+
bower_components
34+
35+
# node-waf configuration
36+
.lock-wscript
37+
38+
# Compiled binary addons (https://nodejs.org/api/addons.html)
39+
build/Release
40+
41+
# Dependency directories
42+
node_modules/
43+
jspm_packages/
44+
45+
# Snowpack dependency directory (https://snowpack.dev/)
46+
web_modules/
47+
48+
# TypeScript cache
49+
*.tsbuildinfo
50+
51+
# Optional npm cache directory
52+
.npm
53+
54+
# Optional eslint cache
55+
.eslintcache
56+
57+
# Microbundle cache
58+
.rpt2_cache/
59+
.rts2_cache_cjs/
60+
.rts2_cache_es/
61+
.rts2_cache_umd/
62+
63+
# Optional REPL history
64+
.node_repl_history
65+
66+
# Output of 'npm pack'
67+
*.tgz
68+
69+
# Yarn Integrity file
70+
.yarn-integrity
71+
72+
# dotenv environment variables file
73+
.env
74+
.env.test
75+
.env.production
76+
77+
# parcel-bundler cache (https://parceljs.org/)
78+
.cache
79+
.parcel-cache
80+
81+
# Next.js build output
82+
.next
83+
out
84+
85+
# Nuxt.js build / generate output
86+
.nuxt
87+
dist
88+
89+
# Gatsby files
90+
.cache/
91+
# Comment in the public line in if your project uses Gatsby and not Next.js
92+
# https://nextjs.org/blog/next-9-1#public-directory-support
93+
# public
94+
95+
# vuepress build output
96+
.vuepress/dist
97+
98+
# Serverless directories
99+
.serverless/
100+
101+
# FuseBox cache
102+
.fusebox/
103+
104+
# DynamoDB Local files
105+
.dynamodb/
106+
107+
# TernJS port file
108+
.tern-port
109+
110+
# Stores VSCode versions used for testing VSCode extensions
111+
.vscode-test
112+
113+
# yarn v2
114+
.yarn/cache
115+
.yarn/unplugged
116+
.yarn/build-state.yml
117+
.yarn/install-state.gz
118+
.pnp.*
119+
120+
docs/.vitepress/cache/
121+
docs/.vitepress/dist/
122+
.vitepress/cache/
123+
.v3-crawler.js

Dockerfile

+8-17
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,12 @@
1-
FROM rust:latest
1+
ARG NODE_VERSION=19
2+
FROM node:${NODE_VERSION}-alpine
23

3-
RUN cargo install mdbook
4+
WORKDIR /usr/src/app
45

5-
# We don't `COPY` the data into the image, because both for `build` and `serve`
6-
# it's useful to mount the data from the host at runtime.
6+
COPY package.json .
7+
RUN npm install
78

8-
# We don't predefine a `WORKDIR` for flexibility to use the kagi or orion Knowledgebase Maps.
9+
COPY . .
910

10-
VOLUME /kagi-docs
11-
12-
EXPOSE 3000
13-
14-
ENTRYPOINT ["mdbook"]
15-
16-
# This serves on 0.0.0.0:3000 by default, suitable for running in a standard Docker network.
17-
# This way the server is reachable from the host via `localhost:3000` when you start the container with `docker run -p 127.0.0.1:3000:3000 ...`.
18-
#
19-
# Alternatively, when you want to run the container in the host network, you might not want to expose the server to other hosts.
20-
# Then you run with `docker run ... --network host <image> serve -n localhost`.
21-
CMD ["serve", "-n", "0.0.0.0"]
11+
RUN npm run docs:build
12+
ENTRYPOINT npm run docs:preview

README.md

+6-27
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Product | Documentation | Repo Directory
2323
[Kagi Search](https://kagi.com) | https://help.kagi.com/kagi | [kagi](https://github.com/kagisearch/kagi-docs/tree/main/kagi)
2424
[Orion Browser](https://browser.kagi.com) | https://help.kagi.com/orion | [orion](https://github.com/kagisearch/kagi-docs/tree/main/orion)
2525

26-
Our documentation efforts are ongoing! We welcome your feedback and
26+
Our documentation efforts are ongoing! We welcome your feedback and
2727
contributions - read on for details!
2828

2929
## Support
@@ -106,33 +106,12 @@ first, and we will help guide you along!
106106
A template in the pull request form will guide you in providing any additional
107107
details we need to help accept your changes.
108108

109-
## Building
110-
111-
All documentation is written to be hosted with the open-source
112-
[mdBook](https://rust-lang.github.io/mdBook/) documentation utility.
113-
114-
Each directory in the [Knowledgebase Map](#knowledgebase-map) is built as its
115-
own book, configured for that products own criteria, look, and feel.
116-
117-
To get started:
118109

119-
1. Install [mdBook](https://rust-lang.github.io/mdBook/guide/installation.html)
120-
2. Navigate to the book you wish to build in the [Knowledgebase Map](#knowledgebase-map)
121-
3. Run `mdbook build` in that directory to compile the book to a `book/`
122-
directory with the rendered contents. You can open `book/index.html` to start browsing.
123-
124-
You can also run `mdbook serve` and open [http://localhost:3000](http://localhost:3000)
125-
to view the documentation in your browser. mdBook will watch your files and automatically
126-
rebuild & refresh the page when the book's files are updated.
127-
128-
See each book's `book.toml` for configuration options we have applied.
110+
## Building
129111

130-
### With Docker
112+
Kagi's docs generated by [Vitepress](https://vitepress.dev/).
131113

132-
If you don't have and don't want to install Rust on your local machine, you can use Docker instead. The command examples assume you're in the root of the Git repository.
114+
### Development on your localhost
133115

134-
1. Build the image `docker build -t kagi-docs .`
135-
2. Run the container to build or serve:
136-
- Build example: `docker run --rm -v /path/to/kagi-docs:/kagi-docs --workdir /kagi-docs/kagi kagi-docs build`.
137-
- Serve example: `docker run -it --rm -v /path/to/kagi-docs:/kagi-docs --workdir /kagi-docs/kagi -p 127.0.0.1:3000:3000 kagi-docs`.
138-
- If mdBooks doesn't stop on Ctrl+C, you can detach with Ctrl+P Ctrl+Q and then run `docker stop <container_name>`
116+
npm install
117+
npm run docs:dev

cloudbuild.yaml

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
steps:
2+
- name: 'node:19'
3+
entrypoint: 'npm'
4+
args: ['install']
5+
- name: 'node:19'
6+
entrypoint: 'npm'
7+
args:
8+
- 'run'
9+
- 'docs:build'
10+
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
11+
entrypoint: 'gsutil'
12+
args:
13+
- '-m'
14+
- 'rsync'
15+
- '-r'
16+
- '-d'
17+
- 'docs/.vitepress/dist/'
18+
- 'gs://kagi-us-east1-docs-vitepress/'
19+
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
20+
entrypoint: 'gcloud'
21+
args:
22+
- 'compute'
23+
- 'url-maps'
24+
- 'invalidate-cdn-cache'
25+
- 'kagi-prod-urlmap-anycast'
26+
- '--path'
27+
- '/*'
28+
- '--host'
29+
- 'docs.kagi.com'
30+
- '--project'
31+
- 'kagi-global'
32+
- name: 'gcr.io/cloud-builders/docker'
33+
entrypoint: 'bash'
34+
args:
35+
- '-c'
36+
- |-
37+
apt-get -y update && \
38+
apt-get install jq -y
39+
echo APPLICATION_ID=KX359CJ2OY > .env
40+
echo API_KEY=$$API_KEY >> .env
41+
docker run --env-file=.env -e "CONFIG=$(cat scrape-config.json | jq -r tostring)" algolia/docsearch-scraper@sha256:7bc1cd5aa4783bf24be9ddd6ef22a629b6b43e217b3fa220b6a0acbdeb83b8f8
42+
secretEnv: ['API_KEY']
43+
availableSecrets:
44+
secretManager:
45+
- versionName: projects/$PROJECT_ID/secrets/kagi-docs-write-api-key/versions/latest
46+
env: 'API_KEY'

0 commit comments

Comments
 (0)