Skip to content

Commit f26c5f0

Browse files
moving global box data to separate json file
1 parent 33cac1f commit f26c5f0

File tree

2 files changed

+30
-26
lines changed

2 files changed

+30
-26
lines changed

scripts/create_output_index_json.py

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -10,32 +10,10 @@ def change_file_ext(filename, extension):
1010
return os.path.splitext(filename)[0] + '.' + extension
1111

1212
def get_global_subitems():
13-
items = [
14-
{
15-
"title": "Product Information Portal",
16-
"description": "Raspberry Pi compliance documents",
17-
"imagepath": "/images/full-sized/PIP.png",
18-
"url": "https://pip.raspberrypi.com/"
19-
},
20-
{
21-
"title": "Datasheets",
22-
"description": "PDF-based documentation",
23-
"imagepath": "/images/full-sized/Datasheets.png",
24-
"url": "https://datasheets.raspberrypi.com"
25-
},
26-
{
27-
"title": "Tutorials",
28-
"description": "Hands-on hardware and software tutorials",
29-
"imagepath": "/images/full-sized/Tutorials.png",
30-
"url": "https://www.raspberrypi.com/tutorials/"
31-
},
32-
{
33-
"title": "Forums",
34-
"description": "User and product support forums",
35-
"imagepath": "/images/full-sized/Forums.png",
36-
"url": "https://forums.raspberrypi.com"
37-
}
38-
]
13+
scripts_dir = os.path.dirname(__file__)
14+
json_path = os.path.join(scripts_dir, "global_boxes.json")
15+
with open(json_path) as json_fh:
16+
items = json.load(json_fh)
3917
return items
4018

4119
def build_tab_from_json(tab, adoc_dir):

scripts/global_boxes.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
[
2+
{
3+
"title": "Product Information Portal",
4+
"description": "Raspberry Pi compliance documents",
5+
"imagepath": "/images/full-sized/PIP.png",
6+
"url": "https://pip.raspberrypi.com/"
7+
},
8+
{
9+
"title": "Datasheets",
10+
"description": "PDF-based documentation",
11+
"imagepath": "/images/full-sized/Datasheets.png",
12+
"url": "https://datasheets.raspberrypi.com"
13+
},
14+
{
15+
"title": "Tutorials",
16+
"description": "Hands-on hardware and software tutorials",
17+
"imagepath": "/images/full-sized/Tutorials.png",
18+
"url": "https://www.raspberrypi.com/tutorials/"
19+
},
20+
{
21+
"title": "Forums",
22+
"description": "User and product support forums",
23+
"imagepath": "/images/full-sized/Forums.png",
24+
"url": "https://forums.raspberrypi.com"
25+
}
26+
]

0 commit comments

Comments
 (0)