From 21cde839490ad7fe1ea93a759a4cd2dcb26e6056 Mon Sep 17 00:00:00 2001 From: Gemma Black Date: Wed, 13 Mar 2019 11:39:54 +0000 Subject: [PATCH] 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. --- docs/deploy.md | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/docs/deploy.md b/docs/deploy.md index fdf016716..7d47e0f73 100644 --- a/docs/deploy.md +++ b/docs/deploy.md @@ -87,3 +87,45 @@ When using the HTML5 router, you need to set up redirect rules that redirect all ```sh /* /index.html 200 ``` + +## AWS Amplify + +1. Set the routerMode in the Docsify project `index.html` to *history* mode. + +```html + +``` + +2. Login to your [AWS Console](https://aws.amazon.com). +3. Go to the [AWS Amplify Dashboard](https://aws.amazon.com/amplify). +4. Choose the **Deploy** route to setup your project. +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 + +```yml +version: 0.1 +frontend: + phases: + build: + commands: + - echo "Nothing to build" + artifacts: + baseDirectory: /docs + files: + - '**/*' + cache: + paths: [] + +``` + +6. Add the following Redirect rules in their displayed order. + +| Source address | Target address | Type | +|----------------|----------------|---------------| +| /<*>.md | /<*>.md | 200 (Rewrite) | +| /<*> | /index.html | 200 (Rewrite) | +