Skip to content

Commit 27c04ce

Browse files
committed
📝 Add a section on how to deploy a branch to your personal Github website.
using `mkdocs gh-deploy`. Add a section on how to configure GitHub Pages.
1 parent e50ef19 commit 27c04ce

File tree

2 files changed

+41
-10
lines changed

2 files changed

+41
-10
lines changed

‎README.md‎

Lines changed: 41 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ Once [installed](#install), you can preview the doc locally as you edit.
6161

6262
### Preview Changes
6363

64+
#### Preview Changes Locally
65+
6466
To preview your work as you edit:
6567

6668
- Run **`mkdocs serve`** locally and keep it running:
@@ -69,13 +71,43 @@ To preview your work as you edit:
6971
mkdocs serve
7072
```
7173
By default, this runs a local web server that hosts the documentation at http://127.0.0.1:8000/ .
72-
* Preview docs in your Web browser. Most changes will update automatically as you edit. Configuration and navigation changes will require restarting the *mkdocs* server `mkdocs* serve`.
73-
* Optionally, you can share the preview with others by uploading them to your repository's `gh-pages` branch
74-
```bash
75-
mkdocs gh-deploy
76-
```
74+
* Preview docs in your Web browser.
75+
Most changes will update automatically as you edit.
76+
Configuration and navigation changes will require restarting `mkdocs serve`.
77+
78+
#### Preview Changes on a Public Website
79+
80+
Optionally, you can share the preview with others by uploading them to your Github repository's `gh-pages` branch.
81+
82+
- First, you need to configure [[#configure-gh-pages|GitHub Pages]] (once).
83+
- Then, to deploy the current branch to your personal GitHub website so that others can take a look at:
84+
```bash
85+
mkdocs gh-deploy
86+
```
87+
88+
There is also a [*GitHub Action*](https://github.com/LoopKit/loopdocs/blob/master/.github/workflows/publish.yml) that automatically builds and deploys the doc each time it the `master` branch is pushed to the repository.
89+
ℹ️ If you deployed your current branch with `mkdocs gh-deploy`, then pushed `master` to the repository afterward, this will automatically deploy `master` and override your previous deployment.
90+
91+
Remember to disable *GitHub Pages* in your repository settings when you are done sharing.
92+
93+
#### Configure GH Pages
94+
95+
The **first** thing you need to do is **configure** your fork of **loopdocs** repository (**once**) so that whenever `gh-pages` is pushed it is automatically deployed to your personal GitHub website. Here is how.
96+
97+
Open **your** fork of **loopdocs** on Github: `https://github.com/YOUR_GITHUB_USERNAME_HERE/loopdocs`
98+
99+
1. Click the **`"⚙️ Settings"`** tab (last one on the right)
100+
2. Click **`Pages`** located under the `Code and Automation` section
101+
3. In the **`Source`** field, select **`Deploy from a Branch`**
102+
4. **First** drop-down under the **`Branch`** section: Select **`gh-pages`**
103+
5. **Second** drop-down: Select **`"/(root)"`**
104+
6. Click **`Save`**
105+
106+
> ![GitHub Pages Configuration](/img/gh_pages_config.png)
107+
108+
Whenever `gh-pages`branch is pushed to your repository, *GitHub Pages* will automatically deploy it to your personal GitHub website:
109+
`https://YOUR_GITHUB_USERNAME_HERE.github.io/loopdocs`
77110

78-
Note that the `master` branch will automatically be published to your personal repository (`gh-pages`) by *Github actions* when it is pushed to the *GitHub* server.
79111

80112
### Find Broken Links
81113

@@ -218,11 +250,10 @@ You can also refer to the above flowchart diagram for a visual representation of
218250

219251
##### When Rules Fail
220252

221-
Using `<span translate="no">text</span>`, backticks (`` `text` ``) and code (`<code>text</code>`) has a-one major drawback.
253+
Using `<span translate="no">text</span>`, backticks (`` `text` ``) and code (`<code>text</code>`) has a drawback and does not work every time.
222254
The automatic translation splits the sentence into 2 parts, one before and one after the non translated text, and can sometimes:
223255
- get confused by this and treat them as 2 separate sentences to be translated independently.
224-
- remove spaces around the `text`, (remember it no longer exists from *Google Translate* point of view)
225-
256+
- remove spaces around the untranslated `text`, (remember it no longer exists from *Google Translate* point of view)
226257

227258
đź’ˇHere are some possible **workarounds**:
228259

@@ -251,7 +282,7 @@ This process require trial and error to find the best approach: the one that wor
251282
These rules to improve automatic translation with Google Translate comes with pluses and minuses:
252283
- Drawbacks:
253284
- Markdown is a bit less readable and more sprinkled with *HTML*.
254-
- Need to publish the website to a **public** website so that it is visible to [Google Translate](https://translate.google.com)
285+
- Need to publish the website to a **public** website visible to [Google Translate](https://translate.google.com)
255286
- Pluses:
256287
- One single source and many potential translations
257288

‎img/gh_pages_config.png‎

90.6 KB
Loading

0 commit comments

Comments
 (0)