-
-
Notifications
You must be signed in to change notification settings - Fork 254
feat: Implement dynamic version dropdown and static language switcher #330
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
b6491ba
Add Netlify configuration for PR previewsThis commit adds netlify.tom…
AR21SM 820d5c7
deleted preview.yml
AR21SM 2c45f6d
added build.sh
AR21SM 29a584b
updated workflows and netlify.toml file
AR21SM 1aee5df
Merge pull request #349 from AR21SM/netlify_setup
aterrel 031010a
Added dynamic version dropdown and static language switcher
AR21SM bd11923
fixed all proposed changes
AR21SM 3b7bd81
updated build-gh-pages.yml
AR21SM 05ddee2
Fixed all Proposed changes
AR21SM 1172e08
fix: correct English URL structure in language switcher
AR21SM e9f7784
styled language switcher to match version switcher design
AR21SM 8131956
undoing the chnages
AR21SM File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,6 +5,7 @@ on: | |
| push: | ||
| branches: | ||
| - main | ||
| - next | ||
|
|
||
| # This job installs dependencies, build the book, and pushes it to `gh-pages` | ||
| jobs: | ||
|
|
@@ -18,19 +19,14 @@ jobs: | |
| with: | ||
| python-version: 3.13 | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| pip install jupyter-book | ||
| pip install sphinx-tags | ||
|
|
||
| - name: Build the book | ||
| run: | | ||
| rm -rf DISCOVER/_tags/* | ||
| sphinx-build -b html DISCOVER/ DISCOVER/_build/html | ||
| bash ci/build_website.sh | ||
|
|
||
| - name: Push book HTML to gh-pages | ||
| uses: peaceiris/[email protected] | ||
AR21SM marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| with: | ||
| github_token: ${{ secrets.GITHUB_TOKEN }} | ||
| publish_dir: ./DISCOVER/_build/html | ||
| destination_dir: dev/ | ||
| keep_files: true | ||
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AR21SM marked this conversation as resolved.
Show resolved
Hide resolved
AR21SM marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| [ | ||
| { | ||
| "code": "en", | ||
| "name_local": "English", | ||
| "direction": "ltr" | ||
| }, | ||
| { | ||
| "code": "es", | ||
| "name_local": "Español", | ||
| "direction": "ltr", | ||
| "hidden": true | ||
| } | ||
|
|
||
| ] |
AR21SM marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| [ | ||
| { | ||
| "version": "dev", | ||
| "url": "https://discover-cookbook.numfocus.org/dev/" | ||
| }, | ||
| { | ||
| "version": "2.0", | ||
| "url": "https://discover-cookbook.numfocus.org/2.0/", | ||
| "preferred": true | ||
| }, | ||
| { | ||
| "version": "1.0", | ||
| "url": "https://discover-cookbook.numfocus.org/1.0/" | ||
| } | ||
|
|
||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| <div class="dropdown"> | ||
| <button class="btn btn-sm btn-outline-secondary dropdown-toggle" type="button" id="language-switcher-button" | ||
| data-bs-toggle="dropdown" aria-expanded="false"> | ||
| {{current_language_name}} | ||
| </button> | ||
| <ul class="dropdown-menu" aria-labelledby="language-switcher-button"> | ||
| {% for item in languages %} | ||
| <li> | ||
| <a class="dropdown-item{% if current_language == item.code %}active{% endif %}" | ||
| href="{{ baseurl }}/{{ current_version }}/{{ item.code }}/{{ pagename }}.html" | ||
| {% if item.direction %}dir="{{ item.direction }}"{% endif %}> | ||
| {{ item.name_local }} | ||
| </a> | ||
| </li> | ||
| {% endfor %} | ||
| </ul> | ||
| </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
|
|
||
| echo "Starting build process..." | ||
|
|
||
| # Install dependencies | ||
| pip install -r requirements.txt | ||
|
|
||
| # Clean tags directory | ||
| rm -rf DISCOVER/_tags/* | ||
|
|
||
| echo "Building English version..." | ||
| sphinx-build -b html DISCOVER/ DISCOVER/_build/html/en | ||
|
|
||
|
|
||
| # Copy root level files if they exist | ||
| if [ -f "DISCOVER/_static/404.html" ]; then | ||
| cp DISCOVER/_static/404.html DISCOVER/_build/html/ | ||
| fi | ||
|
|
||
| # if [ -f "DISCOVER/_static/index.html" ]; then | ||
| # cp DISCOVER/_static/index.html DISCOVER/_build/html/ | ||
| # fi | ||
|
|
||
| echo "Build completed successfully" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| [build] | ||
| publish = "DISCOVER/_build/html" | ||
| command = "bash ci/build_website.sh" | ||
|
|
||
| [build.environment] | ||
| PYTHON_VERSION = "3.12" |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.