Skip to content

Commit 21cde83

Browse files
authored
Docsify publishing with AWS Amplify steps
This is to help users be able to publish Docsify with AWS Amplify, so they don't get stuck on redirect rules and hash state issues.
1 parent c1d4961 commit 21cde83

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

docs/deploy.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,45 @@ When using the HTML5 router, you need to set up redirect rules that redirect all
8787
```sh
8888
/* /index.html 200
8989
```
90+
91+
## AWS Amplify
92+
93+
1. Set the routerMode in the Docsify project `index.html` to *history* mode.
94+
95+
```html
96+
<script>
97+
window.$docsify = {
98+
loadSidebar: true,
99+
routerMode: 'history'
100+
}
101+
</script>
102+
```
103+
104+
2. Login to your [AWS Console](https://aws.amazon.com).
105+
3. Go to the [AWS Amplify Dashboard](https://aws.amazon.com/amplify).
106+
4. Choose the **Deploy** route to setup your project.
107+
5. When prompted, keep the build settings empty if you're serving your docs within the root directory. If you're serving your docs from a different directory, customise your amplify.yml
108+
109+
```yml
110+
version: 0.1
111+
frontend:
112+
phases:
113+
build:
114+
commands:
115+
- echo "Nothing to build"
116+
artifacts:
117+
baseDirectory: /docs
118+
files:
119+
- '**/*'
120+
cache:
121+
paths: []
122+
123+
```
124+
125+
6. Add the following Redirect rules in their displayed order.
126+
127+
| Source address | Target address | Type |
128+
|----------------|----------------|---------------|
129+
| /<*>.md | /<*>.md | 200 (Rewrite) |
130+
| /<*> | /index.html | 200 (Rewrite) |
131+

0 commit comments

Comments
 (0)