Skip to content

Commit ccf5132

Browse files
updated & for custom navbar
1 parent 85ada2f commit ccf5132

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

assets/scripts/DocsNav.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,12 @@ jobs:
2727
run: |
2828
git config user.name github-actions[bot]
2929
git config user.email github-actions[bot]@users.noreply.github.com
30+
31+
# Define the URL of the navbar to be used
32+
NAVBAR_URL="https://raw.githubusercontent.com/TuringLang/turinglang.github.io/main/assets/scripts/navbar.html"
3033
3134
# Update all HTML files in the current directory (gh-pages root)
32-
./insert_navbar.sh .
35+
./insert_navbar.sh . $NAVBAR_URL
3336
3437
# Remove the insert_navbar.sh file
3538
rm insert_navbar.sh

assets/scripts/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ This `scripts` folder contains utilities for building Turing language satellite
77

88
Add a new Github Actions workflow, `DocsNav.yml`, in your `main` or `master` branch.
99

10-
You can find `DocsNav.yml` template [here](DocsNav.yml).
10+
You can find `DocsNav.yml` template [here](DocsNav.yml), Update the NAVBAR URL in case you want to use another navigation bar and make sure NAVBAR START AND NAVBAR END comments are there in your new navigation bar.
1111

1212
See [AbstractMCMC.jl](https://github.com/TuringLang/AbstractMCMC.jl/blob/master/.github/workflows/DocsNav.yml) for an example.

assets/scripts/insert_navbar.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
11
#!/bin/bash
22

3-
# This script inserts a top navigation bar (e.g., `navbar.html`) into Documenter.jl generated sites.
3+
# This script inserts a top navigation bar into Documenter.jl generated sites.
44
# The resulting output is similar to MultiDocumenter's navigation menu. The navigation menu is
55
# hard-coded at the moment, which could be improved in the future.
66
# It checks all HTML files in the specified directory and its subdirectories.
77

8-
# URL of the navigation bar HTML file
9-
NAVBAR_URL="https://raw.githubusercontent.com/TuringLang/turinglang.github.io/main/assets/scripts/navbar.html"
8+
# Check if the correct number of arguments are provided
9+
if [ "$#" -ne 2 ]; then
10+
echo "Usage: $0 <html-directory> <navbar-url>"
11+
exit 1
12+
fi
1013

1114
# Directory containing HTML files (passed as the first argument to the script)
1215
HTML_DIR=$1
1316

17+
# URL of the navigation bar HTML file (passed as the second argument to the script)
18+
NAVBAR_URL=$2
19+
1420
# Download the navigation bar HTML content
1521
NAVBAR_HTML=$(curl -s $NAVBAR_URL)
1622

0 commit comments

Comments
 (0)