Skip to content

Commit 947dde0

Browse files
committed
refactor(docs): simplify site URL configuration
- Use SITE_URL env var with !ENV syntax in mkdocs.yml. - Derive base_url from SITE_URL in gen_test_doc.py (no separate env var). - Remove unused GEN_TEST_DOC_VERSION from tox.ini. - Local builds work without env vars; production builds set SITE_URL.
1 parent 7f9f39a commit 947dde0

3 files changed

Lines changed: 17 additions & 20 deletions

File tree

mkdocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
site_name: Ethereum Execution Specs
22
site_description: The Ethereum Execution Layer Python Specifications and Tests
3-
site_url: https://eest.ethereum.org/
3+
site_url: !ENV [SITE_URL, 'https://steel.ethereum.foundation/docs/']
44
repo_url: https://github.com/ethereum/execution-specs
55
repo_name: execution-specs
66
edit_uri: edit/main/docs/

packages/testing/src/execution_testing/cli/pytest_commands/plugins/filler/gen_test_doc/gen_test_doc.py

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -341,37 +341,35 @@ def get_doc_site_base_url(self) -> str:
341341
This is required in order to include docs/javascripts/site.js, for
342342
example, in the standalone html pages.
343343
344-
Github pages deploys to a sub-directory "execution-spec-tests" and mike
345-
deploys a version of the site underneath a sub-directory named after
346-
the version, e.g.:
344+
The docs are deployed to steel.ethereum.foundation/docs/<branch>/
345+
with the MkDocs version provider for version switching:
347346
348-
- https://eest.ethereum.org/main/
349-
- https://eest.ethereum.org/v4.1.0/
347+
- https://steel.ethereum.foundation/docs/forks/amsterdam/
348+
- https://steel.ethereum.foundation/docs/mainnet/
350349
351350
We need to be able to include the javascript available at:
352351
353-
- https://eest.ethereum.org/main/javascripts/site.js
352+
- https://steel.ethereum.foundation/docs/forks/amsterdam/javascripts/site.js
354353
"""
354+
# Check for SITE_URL first (set by CI workflow or user)
355+
# and derive the base path from it
356+
site_url = os.getenv("SITE_URL", None)
357+
if site_url:
358+
from urllib.parse import urlparse
359+
360+
return urlparse(site_url).path
361+
355362
ci = os.getenv("CI", None)
356363
github_ref_name = os.getenv("GITHUB_REF_NAME", None)
357-
doc_version = os.getenv("GEN_TEST_DOC_VERSION", None)
358364
if ci and github_ref_name:
359-
return f"/execution-spec-tests/{github_ref_name}/"
365+
return f"/docs/{github_ref_name}/"
360366
if ci and not github_ref_name:
361367
raise Exception(
362368
"Failed to determine target doc version "
363369
"(no GITHUB_REF_NAME env?)."
364370
)
365-
if (
366-
"--strict" in sys.argv or "deploy" in sys.argv
367-
) and not doc_version:
368-
# assume we're trying to deploy manually via mike (locally)
369-
raise Exception(
370-
"Failed to determine target doc version during strict build "
371-
"(set GEN_TEST_DOC_VERSION env var)."
372-
)
373-
# local test build, e.g. via `uv run mkdocs serve`
374-
return "/execution-spec-tests/"
371+
# local test build, e.g. via `uv run mkdocs serve` or tox
372+
return "/"
375373

376374
def add_global_page_props_to_env(self) -> None:
377375
"""Populate global page properties used in j2 templates."""

tox.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,6 @@ commands =
212212
[testenv:mkdocs]
213213
description = Build HTML site documentation with mkdocs
214214
setenv =
215-
GEN_TEST_DOC_VERSION = "tox"
216215
# Set DYLD_FALLBACK_LIBRARY_PATH: Required for `cairosvg` so tox can find `libcairo-2`?
217216
# https://squidfunk.github.io/mkdocs-material/plugins/requirements/image-processing/?h=cairo#cairo-library-was-not-found
218217
DYLD_FALLBACK_LIBRARY_PATH = /opt/homebrew/lib

0 commit comments

Comments
 (0)