Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
Commit 8fa9d52f authored by Deepak Khatri's avatar Deepak Khatri :dog:
Browse files

WIP: fix OSHW mark image src (2)

parent 762adfcd
1 merge request!89Docs updates - chapter restructuring, images, and more
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
{% if pages_slug %} {% if pages_slug %}
<img src="../../../../{{pages_slug}}/_static/images/oshw/{{board}}_{{path | replace('/', '#')}}_{{oshw_id}}.svg" alt="{{board}} OSHW mark"/> <img src="../../../../{{pages_slug}}/_static/images/oshw/{{board}}_{{path | replace('/', '#')}}_{{oshw_id}}.svg" alt="{{board}} OSHW mark"/>
{% else %} {% else %}
<img src="../../../../_static/images/oshw/{{board}}_{{path | replace('/', '#')}}_{{oshw_id}}.svg" alt="{{board}} OSHW mark"/> <img src="../../../../_static/images/oshw/{{board}}_{{path | replace('/', '-')}}_{{oshw_id}}.svg" alt="{{board}} OSHW mark"/>
{% endif %} {% endif %}
</a> </a>
</p> </p>
......
...@@ -30,18 +30,21 @@ oshw_details = [] ...@@ -30,18 +30,21 @@ oshw_details = []
for (dirpath, dirnames, filenames) in os.walk(oshw_logos_path): for (dirpath, dirnames, filenames) in os.walk(oshw_logos_path):
for filename in filenames: for filename in filenames:
if filename.endswith('.svg'): if filename.endswith('.svg'):
oshw_logo_name = filename.replace('#','/').split(".")[0] oshw_logo_name = filename.split(".")[0]
oshw_details.append(oshw_logo_name.split('_')) board, path, oshw_id = oshw_logo_name.split('_')
path = path.replace('-','/')
oshw_details.append([board, path, oshw_id])
# Unique boards path information # Unique boards path information
boards_path = [] boards_path = []
for board, path, oshw_id in oshw_details: for board, path, oshw_id in oshw_details:
for (dirpath, dirnames, filenames) in os.walk("boards"): for (dirpath, dirnames, filenames) in os.walk("boards"):
if '/'+path+'/' in dirpath+'/': if '/'+path+'/' in dirpath+'/':
if path+'/' not in dirpath: if path+'/' not in dirpath:
boards_path.append(dirpath) boards_path.append(dirpath)
boards_path = set(boards_path) boards_path = set(boards_path)
print(boards_path)
# -- Project information -- # -- Project information --
project = 'BeagleBoard Docs' project = 'BeagleBoard Docs'
copyright = '2024, BeagleBoard.org Foundation' copyright = '2024, BeagleBoard.org Foundation'
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment