diff --git a/.github/workflows/build-explorer.yml b/.github/workflows/build-explorer.yml index b0e70da..3691b11 100644 --- a/.github/workflows/build-explorer.yml +++ b/.github/workflows/build-explorer.yml @@ -68,14 +68,14 @@ jobs: run: | git checkout package.json npx rdf add file "https://brickschema.org/schema/1.3/Brick" vocab/brick/1.3/Brick.ttl - npx rdf make site --output public/1.3 + npx rdf make site --output public/1.3 -B 1.3 - name: handle brick 1.4 working-directory: rdf-toolkit/explorer run: | git checkout package.json npx rdf add file "https://brickschema.org/schema/1.4/Brick" vocab/brick/1.4/Brick.ttl - npx rdf make site --output public/1.4 + npx rdf make site --output public/1.4 -B 1.3 - name: rewrite for version navigation run: find rdf-toolkit/explorer/public -name "*.html" | xargs -n 1 -P 4 uv run add_versions.py diff --git a/add_versions.py b/add_versions.py index 4025b04..c540010 100644 --- a/add_versions.py +++ b/add_versions.py @@ -30,8 +30,11 @@ select = soup.new_tag('select', {'id': 'brickVersionDropdown'}) # create options -for text, href in links.items(): - option = soup.new_tag('option', value=href) +for index,(text, href) in enumerate(links.items()): + if index == 0: + option = soup.new_tag('option', value=href, selected='selected') + else: + option = soup.new_tag('option', value=href) option.string = text select.append(option) # add the brickVersionDropdown id to the select tag