diff --git a/.github/workflows/docs-dev.yml b/.github/workflows/docs-dev.yml
index 6a6acd55..ce07360d 100644
--- a/.github/workflows/docs-dev.yml
+++ b/.github/workflows/docs-dev.yml
@@ -26,10 +26,13 @@ jobs:
# First configure git correctly
# Then use the alias of the current dev version to delete it based on its identifier
# Then deploy the new version so that there is only one dev version at a time
+ # Only make dev the default if no stable version exists yet, so stable stays the default once published
run: |
git config user.name github-actions
git config user.email github-actions@github.com
git fetch origin gh-pages --depth=1
mike delete --push $(mike list | grep dev | awk '{print $1}' | tr -d '()')
mike deploy --push --update-aliases "${{ env.package_version }}-dev" dev
- mike set-default --push --allow-empty dev
+ if ! mike list stable > /dev/null 2>&1; then
+ mike set-default --push dev
+ fi
diff --git a/.github/workflows/docs-stable.yml b/.github/workflows/docs-stable.yml
index 8e4dc50c..d7f765e9 100644
--- a/.github/workflows/docs-stable.yml
+++ b/.github/workflows/docs-stable.yml
@@ -2,9 +2,12 @@ name: Publish Stable Docs
on:
workflow_dispatch:
+ release:
+ types: [published]
jobs:
publish:
+ if: github.event_name == 'workflow_dispatch' || !github.event.release.prerelease
runs-on: ubuntu-latest
steps:
- name: Checkout repository
@@ -20,6 +23,9 @@ jobs:
python -c 'import pathpyG; print(f"package_version={pathpyG.__version__}")' >> "$GITHUB_ENV"
- name: Publish docs
+ env:
+ # Pin "Open in Colab" links to the commit these docs are built from
+ DOCS_GIT_REF: ${{ github.sha }}
run: |
git config user.name github-actions
git config user.email github-actions@github.com
diff --git a/docs/getting_started.md b/docs/getting_started.md
index b4a8ebdc..ec3e5beb 100644
--- a/docs/getting_started.md
+++ b/docs/getting_started.md
@@ -30,9 +30,6 @@ uv pip install pathpyg[cu129]
You can install the latest stable release of PathpyG via pip:
-!!! warning "TODO"
- This is not yet available. We will release the first stable version soon.
-
```bash
pip install pathpyg
```
diff --git a/docs/overrides/home.html b/docs/overrides/home.html
index 5d897137..6a39918e 100644
--- a/docs/overrides/home.html
+++ b/docs/overrides/home.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "main.html" %}
{% block tabs %}
diff --git a/docs/overrides/main.html b/docs/overrides/main.html
index bb89cd22..4f491bac 100644
--- a/docs/overrides/main.html
+++ b/docs/overrides/main.html
@@ -1,6 +1,11 @@
{% extends "base.html" %}
+{% block announce -%}
+ {%- if config.extra.docs_version.endswith("-dev") %}
+ You're viewing the development docs. Features documented here may not be in a released version of pathpyG yet.
+ {%- endif %}
+{%- endblock %}
{% block content %}
@@ -8,14 +13,14 @@
{% include ".icons/material/download.svg" %}
-
+
{% include ".icons/simple/googlecolab.svg" %}
{% endif %}
{{ super() }}
{% endblock %}
-
+
{% block outdated %}
You're not viewing the latest version.
diff --git a/mkdocs.yml b/mkdocs.yml
index e885dbbb..60a9922c 100644
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -79,8 +79,13 @@ plugins:
extra:
version:
- default: dev
+ # Only the stable version hides the "not the latest version" banner
+ default: stable
provider: mike
+ # Version being built by mike (e.g. "0.2.0-dev"); empty for plain mkdocs builds
+ docs_version: !ENV [MIKE_DOCS_VERSION, ""]
+ # Git ref for "Open in Colab" links; set to the build commit for stable docs
+ git_ref: !ENV [DOCS_GIT_REF, main]
extra_css:
- overrides/assets/stylesheets/header.css # Remove the sitename from the header, since the logo already contains it