Skip to content

Commit 36fdb3e

Browse files
committed
Fixes after review
1 parent a10f07e commit 36fdb3e

File tree

6 files changed

+19
-10
lines changed

6 files changed

+19
-10
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
- name: Build docs
2727
run: |
2828
mkdocs build --strict
29+
./check-links.sh
2930
3031
# Only deploy on master
3132
- name: Deploy docs

README.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,27 +14,33 @@ This is done by creating a pull request.
1414
Make sure you have Python3 installed.
1515

1616
```
17-
git clone https://github.com/waterlinked/waterlinked.github.io
18-
cd waterlinked.github.io
17+
git clone https://github.com/waterlinked/docs.git
18+
cd docs
1919
2020
python -m venv venv
2121
source venv/bin/activate (Linux)
2222
venv\Scripts\activate.bat (Windows)
2323
pip install -r requirements.txt
24-
./install-hooks.sh
2524
26-
mkdocs serve
25+
./install-hooks.sh # (Optional) To automatically check links on git push
2726
```
2827

2928
2. Make changes using your favorite editor
3029

3130
3. Test them
3231

32+
```
33+
mkdocs serve # Allow you to view the changes on your browser
34+
```
3335
* Fire up your browser and go to localhost:8000
3436

35-
## Deploy changes to server
36-
After the changes have been tested and they work, push the changes to the master branch and Github will build the website and publish it on https://docs.waterlinked.com.
37+
Verify links are valid:
3738

38-
## Automatic link-checker
39-
When you push to git, all links are automatically checked. Any errors will be listed in your terminal. If you want to check links before pushing, use > ./hooks/pre-push
39+
```
40+
./check-links.sh
41+
```
42+
43+
## Deploy changes to server
44+
After the changes have been tested and they work, push the changes to a branch, and make a merge request. The documentation site will built automatically and links will be verified.
4045

46+
Once the pull request is merged the documentation will be automatically built and published to https://docs.waterlinked.com.
File renamed without changes.

hooks/pre-push renamed to check-links.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/bin/bash
22
# Pre-push hook: Custom linkchecker for local links, Build MkDocs locally and run LinkChecker on external links
33

4+
# Exit on error
45
set -e
56

67
# === Paths ===
@@ -19,7 +20,7 @@ echo "Checking internal links in markdown files..."
1920

2021
set +e
2122
#Using custom python script for internal link checking:
22-
"$VENV_BIN/python" "$PROJECT_ROOT/checklinks.py" "$DOCS_DIR"
23+
"$VENV_BIN/python" "$PROJECT_ROOT/check-internal-links.py" "$DOCS_DIR"
2324
RESULT_INTERNAL=$?
2425

2526
set -e

install-hooks.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/bash
22
mkdir -p .git/hooks
3-
ln -sf ../../hooks/pre-push .git/hooks/pre-push
3+
ln -sf check-links.sh .git/hooks/pre-push
44
echo "Pre-push hook installed!"

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
mkdocs==1.2.3
22
mkdocs-material==7.2.0
33
jinja2<3.1.0
4+
LinkChecker==10.3.0

0 commit comments

Comments
 (0)