Skip to content

Commit 94ab7d7

Browse files
authored
Add vitepress doc page (#11944)
I fixed the test-builds repo to work properly, and this also links out to a user example repo, but I want to improve that probably with a logo. Refs Refs readthedocs/addons#503 <!-- readthedocs-preview docs start --> --- :books: Documentation previews :books: - User's documentation (`docs`): https://docs--11944.org.readthedocs.build/en/11944/ <!-- readthedocs-preview docs end --> <!-- readthedocs-preview dev start --> - Developer's documentation (`dev`): https://dev--11944.org.readthedocs.build/en/11944/ <!-- readthedocs-preview dev end -->
1 parent 04dd0e6 commit 94ab7d7

File tree

2 files changed

+92
-0
lines changed

2 files changed

+92
-0
lines changed

docs/user/intro/doctools.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,22 @@ Below is a list of popular documentation tools that you can use to write your do
6464
Written in
6565
:bdg-info:`rust`
6666

67+
.. grid-item-card:: VitePress
68+
:link: vitepress.html
69+
70+
VitePress is a static site generator with a focus on performance and simplicity.
71+
72+
Supported formats
73+
:bdg-success:`md`
74+
6775
.. grid-item-card:: Antora
6876
:link: antora.html
6977

7078
Antora is a static site generator for creating documentation sites from AsciiDoc content.
7179

7280
Supported formats
7381
:bdg-success:`adoc`
82+
7483
Written in
7584
:bdg-info:`javascript`
7685

@@ -82,4 +91,5 @@ Below is a list of popular documentation tools that you can use to write your do
8291
/intro/docusaurus
8392
/intro/markdoc
8493
/intro/mdbook
94+
/intro/vitepress
8595
/intro/antora

docs/user/intro/vitepress.rst

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
VitePress
2+
=========
3+
4+
.. meta::
5+
:description lang=en: Learn how to host VitePress documentation on Read the Docs.
6+
7+
`VitePress`_ is a static site generator with a focus on performance and simplicity.
8+
9+
Minimal configuration is required to build an existing VitePress project on Read the Docs.
10+
11+
.. code-block:: yaml
12+
:caption: .readthedocs.yaml
13+
14+
version: 2
15+
16+
build:
17+
os: ubuntu-lts-latest
18+
tools:
19+
nodejs: "latest"
20+
jobs:
21+
install:
22+
- npm install vitepress
23+
build:
24+
html:
25+
# The site was created by running `vitepress init`
26+
# and following the official guide
27+
# https://vitepress.dev/guide/getting-started
28+
- vitepress build docs
29+
- mkdir -p $READTHEDOCS_OUTPUT/
30+
- mv docs/.vitepress/dist $READTHEDOCS_OUTPUT/html
31+
32+
.. _VitePress: https://vitepress.dev/
33+
34+
Getting started
35+
---------------
36+
37+
- If you have an existing VitePress project you want to host on Read the Docs, check out our :doc:`/intro/add-project` guide.
38+
- If you're new to VitePress, check out the official `Getting started with VitePress`_ guide.
39+
40+
.. _Getting started with VitePress: https://vitepress.vuejs.org/guide/getting-started.html
41+
42+
Using the proper base path
43+
--------------------------
44+
45+
To ensure that your VitePress site works correctly on Read the Docs,
46+
you need to set the ``base`` option in your VitePress configuration to the correct base path:
47+
48+
.. code-block:: js
49+
:caption: .vitepress/config.js
50+
51+
import { defineConfig } from 'vitepress'
52+
53+
// https://vitepress.dev/reference/site-config
54+
export default defineConfig({
55+
// Use Canonical URL, but only the path and with no trailing /
56+
// End result is like: `/en/latest`
57+
base: process.env.READTHEDOCS_CANONICAL_URL
58+
? new URL(process.env.READTHEDOCS_CANONICAL_URL).pathname.replace(/\/$/, "")
59+
: "",
60+
61+
title: "My Awesome Project",
62+
description: "A VitePress Site",
63+
})
64+
65+
Example repository and demo
66+
---------------------------
67+
68+
Production example from DbToolsBundle
69+
https://dbtoolsbundle.readthedocs.io/en/stable/
70+
71+
Example repository
72+
https://github.com/readthedocs/test-builds/tree/vitepress
73+
74+
Demo
75+
https://test-builds.readthedocs.io/en/vitepress/
76+
77+
Further reading
78+
---------------
79+
80+
* `VitePress documentation`_
81+
82+
.. _VitePress documentation: https://vitepress.dev/

0 commit comments

Comments
 (0)