From 8fa9d52f5d5b4732c8f03914cafcabd5bd2ff987 Mon Sep 17 00:00:00 2001
From: Deepak Khatri <lorforlinux@beagleboard.org>
Date: Sat, 30 Mar 2024 00:33:37 +0530
Subject: [PATCH] WIP: fix OSHW mark image src (2)

---
 ...9.svg => BeagleBone AI_beaglebone-ai_US000169.svg} |  0
 ...S002616.svg => BeagleY-AI_beagley-ai_US002616.svg} |  0
 _templates/oshw.html                                  |  2 +-
 conf.py                                               | 11 +++++++----
 4 files changed, 8 insertions(+), 5 deletions(-)
 rename _static/images/oshw/{BeagleBone AI_beaglebone#ai_US000169.svg => BeagleBone AI_beaglebone-ai_US000169.svg} (100%)
 rename _static/images/oshw/{BeagleY-AI_beagley#ai_US002616.svg => BeagleY-AI_beagley-ai_US002616.svg} (100%)

diff --git a/_static/images/oshw/BeagleBone AI_beaglebone#ai_US000169.svg b/_static/images/oshw/BeagleBone AI_beaglebone-ai_US000169.svg
similarity index 100%
rename from _static/images/oshw/BeagleBone AI_beaglebone#ai_US000169.svg
rename to _static/images/oshw/BeagleBone AI_beaglebone-ai_US000169.svg
diff --git a/_static/images/oshw/BeagleY-AI_beagley#ai_US002616.svg b/_static/images/oshw/BeagleY-AI_beagley-ai_US002616.svg
similarity index 100%
rename from _static/images/oshw/BeagleY-AI_beagley#ai_US002616.svg
rename to _static/images/oshw/BeagleY-AI_beagley-ai_US002616.svg
diff --git a/_templates/oshw.html b/_templates/oshw.html
index 8d7364f6..3b12a3ec 100644
--- a/_templates/oshw.html
+++ b/_templates/oshw.html
@@ -10,7 +10,7 @@
               {% if pages_slug %}
                 <img src="../../../../{{pages_slug}}/_static/images/oshw/{{board}}_{{path | replace('/', '#')}}_{{oshw_id}}.svg" alt="{{board}} OSHW mark"/>
               {% 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 %}
             </a>
         </p>
diff --git a/conf.py b/conf.py
index 15876aee..29ea0396 100644
--- a/conf.py
+++ b/conf.py
@@ -30,18 +30,21 @@ oshw_details = []
 for (dirpath, dirnames, filenames) in os.walk(oshw_logos_path):
     for filename in filenames:
         if filename.endswith('.svg'):
-            oshw_logo_name = filename.replace('#','/').split(".")[0]
-            oshw_details.append(oshw_logo_name.split('_'))
-
+            oshw_logo_name = filename.split(".")[0]
+            board, path, oshw_id = oshw_logo_name.split('_')
+            path = path.replace('-','/')
+            oshw_details.append([board, path, oshw_id])
+            
 # Unique boards path information
 boards_path = []
 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+'/' not in dirpath:
                 boards_path.append(dirpath)
 boards_path = set(boards_path)
 
+print(boards_path)
 # -- Project information --
 project = 'BeagleBoard Docs'
 copyright = '2024, BeagleBoard.org Foundation'
-- 
GitLab