Skip to content

Commit

Permalink
fix version
Browse files Browse the repository at this point in the history
  • Loading branch information
gtfierro committed Oct 5, 2024
1 parent 258648b commit 8188dbc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion add_versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,18 @@
# rewrite ALL data-href attributes to start with the corresponding value
print(f"Check INPUT_FILE: {input_file.removeprefix(base_dir)}")
input_file_end = input_file.removeprefix(base_dir)
version = "/"
for text, href in links.items():
if input_file_end.startswith(href) and href != "/":
print(f"Rewriting all data-href attributes to start with {href}")
version = href
for a in soup.find_all('a', {'data-href': True}):
a['data-href'] = href + a['data-href']

select = soup.new_tag('select', {'id': 'brickVersionDropdown'})
# create options
for index,(text, href) in enumerate(links.items()):
if index == 0:
if href == version:
option = soup.new_tag('option', value=href, selected='selected')
else:
option = soup.new_tag('option', value=href)
Expand Down

0 comments on commit 8188dbc

Please sign in to comment.