|
38 | 38 | build_date = _dt.date.today().strftime("%d %b %Y") |
39 | 39 |
|
40 | 40 | # Values exposed to topindex.html and footer templates. |
41 | | -# Resolve the parent (openmv-doc) repo's HEAD SHA at build time so |
42 | | -# "Edit this page" and the AI dropdown's raw-source link both pin to |
43 | | -# the exact commit that produced the page. Falls back to "master" if |
44 | | -# `git` isn't available (e.g. shallow tarball checkouts). |
| 41 | +# Resolve this submodule's HEAD SHA at build time so "Edit this |
| 42 | +# page" and the AI dropdown's raw-source link both pin to the exact |
| 43 | +# commit that produced the page. The RST files physically live in |
| 44 | +# openmv/micropython-doc — the parent openmv-doc repo only carries |
| 45 | +# a submodule pointer, so GitHub blob URLs there 404. Falls back to |
| 46 | +# "master" if `git` isn't available. |
45 | 47 | try: |
46 | | - _parent_repo = os.path.abspath( |
47 | | - os.path.join(os.path.dirname(__file__), "..", "..") |
48 | | - ) |
49 | 48 | source_version = subprocess.check_output( |
50 | 49 | ["git", "rev-parse", "HEAD"], |
51 | | - cwd=_parent_repo, |
| 50 | + cwd=os.path.dirname(os.path.abspath(__file__)), |
52 | 51 | stderr=subprocess.DEVNULL, |
53 | 52 | ).decode().strip() |
54 | 53 | except Exception: |
|
58 | 57 | "openmv_version": openmv_version, |
59 | 58 | "micropython_version": micropython_version, |
60 | 59 | "build_date": build_date, |
61 | | - # Tells Shibuya where the page source lives — used by the "Edit |
62 | | - # this page" link, and as a fallback for the AI dropdown's |
63 | | - # "Open in ChatGPT/Claude/Perplexity" raw-source links when |
64 | | - # html_baseurl isn't reachable. Points at the user-facing |
65 | | - # openmv-doc parent repo (GitHub renders submodule contents |
66 | | - # through the parent's path). |
| 60 | + # "Edit this page" + AI raw-source links point at the submodule |
| 61 | + # repo where the RST source actually lives. The user-facing |
| 62 | + # navbar/footer GitHub icon is controlled separately by |
| 63 | + # html_theme_options["github_url"]. |
67 | 64 | "source_type": "github", |
68 | 65 | "source_user": "openmv", |
69 | | - "source_repo": "openmv-doc", |
70 | | - "source_docs_path": "/micropython/docs/", |
| 66 | + "source_repo": "micropython-doc", |
| 67 | + "source_docs_path": "/docs/", |
71 | 68 | "source_version": source_version, |
72 | 69 | } |
73 | 70 |
|
|
0 commit comments