From de1448c368afe95c679b585042d9a443b9084201 Mon Sep 17 00:00:00 2001 From: Nate Contino Date: Thu, 12 Dec 2024 11:12:45 +0000 Subject: [PATCH] Remove pip/forum/datasheet/tutorials links on every boxes page, instead add those links to the sidebar --- documentation/global_boxes.json | 26 ----------- jekyll-assets/_layouts/docs.html | 72 +++++++++++++++++++++++++++++ scripts/create_output_index_json.py | 13 ------ 3 files changed, 72 insertions(+), 39 deletions(-) delete mode 100644 documentation/global_boxes.json diff --git a/documentation/global_boxes.json b/documentation/global_boxes.json deleted file mode 100644 index 37b59b7a42..0000000000 --- a/documentation/global_boxes.json +++ /dev/null @@ -1,26 +0,0 @@ -[ - { - "title": "Product Information Portal", - "description": "Raspberry Pi compliance documents", - "imagepath": "/images/full-sized/PIP.png", - "url": "https://pip.raspberrypi.com/" - }, - { - "title": "Datasheets", - "description": "PDF-based documentation", - "imagepath": "/images/full-sized/Datasheets.png", - "url": "https://datasheets.raspberrypi.com" - }, - { - "title": "Tutorials", - "description": "Hands-on hardware and software tutorials", - "imagepath": "/images/full-sized/Tutorials.png", - "url": "https://www.raspberrypi.com/tutorials/" - }, - { - "title": "Forums", - "description": "User and product support forums", - "imagepath": "/images/full-sized/Forums.png", - "url": "https://forums.raspberrypi.com" - } -] \ No newline at end of file diff --git a/jekyll-assets/_layouts/docs.html b/jekyll-assets/_layouts/docs.html index daae62b60d..ca88301673 100644 --- a/jekyll-assets/_layouts/docs.html +++ b/jekyll-assets/_layouts/docs.html @@ -165,6 +165,78 @@

{% endif %} {% endfor %} + + + + + + + + diff --git a/scripts/create_output_index_json.py b/scripts/create_output_index_json.py index 2756e9c822..1f94a152e4 100755 --- a/scripts/create_output_index_json.py +++ b/scripts/create_output_index_json.py @@ -9,12 +9,6 @@ def change_file_ext(filename, extension): return os.path.splitext(filename)[0] + '.' + extension -def get_global_subitems(src_dir): - json_path = os.path.join(src_dir, "global_boxes.json") - with open(json_path) as json_fh: - items = json.load(json_fh) - return items - def build_tab_from_json(tab, adoc_dir, img_dir): json_path = os.path.join(adoc_dir, tab['from_json']) tab_key = tab['directory'] @@ -47,7 +41,6 @@ def build_tab_from_json(tab, adoc_dir, img_dir): output_json = sys.argv[2] input_dir = sys.argv[3] images_dir = sys.argv[4] - global_subitems = get_global_subitems(os.path.join(input_dir, '..')) with open(input_json) as json_fh: data = json.load(json_fh) found_default_tab = False @@ -72,12 +65,6 @@ def build_tab_from_json(tab, adoc_dir, img_dir): del data['tabs'][tab_index] else: raise Exception("Tab '{}' in '{}' has neither '{}' nor '{}'".format(tab['title'], input_json, 'path', 'from_json')) - # add the global boxes - if 'subitems' in tab: - for item in global_subitems: - tab['subitems'].append(item) - else: - print("WARNING: no subitems set in {}".format(tab['title'])) if not found_default_tab: print("WARNING: no default_tab set in {} so index page will look odd".format(input_json))