You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+59-96Lines changed: 59 additions & 96 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,14 +13,20 @@ A robust, modern documentation viewer built for rendering Markdown files with ad
13
13
## Quick Start
14
14
15
15
### Development Setup
16
-
[Fork this Repo](https://github.com/litruv/Docs-Viewer/fork)
16
+
17
+
[Fork this Repo](https://github.com/example/Docs-Viewer/fork)
17
18
18
19
#### Updating
20
+
19
21
##### From GitHub
22
+
20
23
On your own repo,
24
+
21
25
1. Click Sync fork
22
26
2. Update branch
27
+
23
28
##### From CLI
29
+
24
30
```sh
25
31
git fetch upstream
26
32
git merge upstream/master
@@ -34,31 +40,31 @@ Deploy anywhere that serves static files. For local development:
34
40
VSCode:
35
41
[LiveServer](https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer) and hit start server in the docs-viewer directory
36
42
37
-
Rawdogging it with notepad:
43
+
Command Line:
44
+
38
45
```sh
39
46
npx live-server
40
47
```
41
48
49
+
#### Cloudflare Pages
42
50
43
-
#### Cloudflare Pages
44
-
45
-
1. Create a new repository on GitHub.
46
-
2. Push your code to the repository.
47
-
3. Go to [Cloudflare Pages](https://pages.cloudflare.com/) and connect your GitHub repository.
48
-
4. Configure the build settings:
49
-
***Production branch:**`main` (or your main branch name)
50
-
***Build command:** Leave empty
51
-
***Build output directory:**`/` (root)
52
-
5. Save and deploy.
51
+
1. Create a new repository on GitHub.
52
+
2. Push your code to the repository.
53
+
3. Go to [Cloudflare Pages](https://pages.cloudflare.com/) and connect your GitHub repository.
54
+
4. Configure the build settings:
55
+
-**Production branch:**`main` (or your main branch name)
56
+
-**Build command:** Leave empty
57
+
-**Build output directory:**`/` (root)
58
+
5. Save and deploy.
53
59
54
60
##### Optional: Cloudflare Worker for OG/Twitter Tags
55
61
56
62
For improved SEO and social sharing, you can use a Cloudflare Worker to dynamically generate OG/Twitter tags.
57
63
58
-
1.Create a new Cloudflare Worker using the code in `cloudflare-worker.js`.
59
-
2.Set the `SITE_URL` environment variable to where your site will be located, eg.`https://lit.ruv.wtf/docs/`
60
-
3.Set the `DOCS_URL` environment variable to the URL where your documentation files are hosted (usually your Cloudflare Pages URL).
61
-
4.Configure a route in your Cloudflare account to route all requests to your Cloudflare Pages site through the worker.
64
+
1. Create a new Cloudflare Worker using the code in `cloudflare-worker.js`.
65
+
2. Set the `SITE_URL` environment variable to where your site will be located, e.g.,`https://example.com/docs/`
66
+
3. Set the `DOCS_URL` environment variable to the URL where your documentation files are hosted (usually your Cloudflare Pages URL).
67
+
4. Configure a route in your Cloudflare account to route all requests to your Cloudflare Pages site through the worker.
62
68
63
69
## Project Structure
64
70
@@ -72,13 +78,12 @@ For improved SEO and social sharing, you can use a Cloudflare Worker to dynamica
72
78
└── styles.css # Theme customization
73
79
```
74
80
75
-
## Configuration
81
+
## Configuration
76
82
77
83
Configure your documentation site with a top-level index file named `index.json`. At minimum, include a `title`, a `defaultPage`, and a list of `documents`:
78
84
79
85
```json
80
86
{
81
-
"title": "My Documentation Site",
82
87
"defaultPage": "welcome",
83
88
"documents": [
84
89
{
@@ -90,124 +95,81 @@ Configure your documentation site with a top-level index file named `index.json`
90
95
}
91
96
```
92
97
93
-
> If you want to quickly get started, copy `example.index.json` to `index.json` in the project root of your own repository:
98
+
> If you want to quickly get started, copy `example.index.json` to `index.json` in the project root:
94
99
95
100
```sh
96
101
cp example.index.json index.json
97
102
```
98
103
99
104
Then adjust the `title`, `defaultPage`, and `documents` array to match your needs.
100
105
101
-
After placing your `index.json` in the project root, the application will:
102
-
103
-
1. Apply your site `title` to the browser tab and page header.
104
-
2. Load the `defaultPage` when no slug is specified in the URL.
105
-
3. Generate a navigation tree from the array of `documents`.
0 commit comments