Skip to content

Commit 2d503f4

Browse files
committed
Fix core product spec pages, with new band format too
1 parent 1fc77c7 commit 2d503f4

File tree

7 files changed

+180
-113
lines changed

7 files changed

+180
-113
lines changed

devices/enviro/index.md

Lines changed: 74 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,19 @@ aside: true
33
---
44

55
<script setup>
6+
import spec from '../../public/device-specs/enviro/v2.yaml?raw'
67
import loadSpec from '../../utils/loadSpec'
7-
import { ref, onMounted } from 'vue'
88

9-
const specs = ref(null)
10-
11-
onMounted(async () => {
12-
const res = await fetch('/device-specs/enviro/v2.yaml')
13-
const yamlText = await res.text()
14-
specs.value = loadSpec(yamlText).value
15-
})
9+
const specs = loadSpec(spec)
1610
</script>
1711

1812
# Enviro (EN2)
1913

20-
<DownloadSpecButton v-if="specs" :spec="specs" deviceTitle="Enviro (EN2)" />
14+
<DownloadSpecButton :spec="specs" deviceTitle="Enviro (EN2)" />
2115

2216
## Images
2317

24-
<DeviceSpecImages v-if="specs" :spec="specs" />
18+
<DeviceSpecImages :spec="specs" />
2519

2620
## Overview
2721

@@ -43,11 +37,79 @@ onMounted(async () => {
4337

4438
</template>
4539

46-
<template v-if="specs && specs['user interface']">
40+
## Overview
41+
42+
<DeviceSpecOverview :spec="specs" />
43+
44+
<template v-if="specs.product.physical">
45+
46+
## Physical
47+
48+
<DeviceSpecSection :spec="specs" sectionName="physical" />
49+
50+
</template>
51+
52+
<template v-if="specs.product.integrations">
53+
54+
## Integrations
55+
56+
<DeviceSpecSection :spec="specs" sectionName="integrations" />
57+
58+
</template>
59+
60+
<template v-if="specs.product['user interface']">
4761

4862
## User Interface
4963

50-
<DeviceSpecSection v-if="specs" :spec="specs" sectionName="user interface" />
64+
<DeviceSpecSection :spec="specs" sectionName="user interface" />
65+
66+
</template>
67+
68+
<template v-if="specs.product.connectivity">
69+
70+
## Connectivity
71+
72+
<DeviceSpecSection :spec="specs" sectionName="connectivity" />
73+
74+
</template>
75+
76+
<template v-if="specs.product.positioning">
77+
78+
## Positioning
79+
80+
<DeviceSpecSection :spec="specs" sectionName="positioning" />
81+
82+
</template>
83+
84+
<template v-if="specs.product.sensors">
85+
86+
## Sensors
87+
88+
<DeviceSpecSection :spec="specs" sectionName="sensors" />
89+
90+
</template>
91+
92+
<template v-if="specs.product.battery">
93+
94+
## Battery
95+
96+
<DeviceSpecSection :spec="specs" sectionName="battery" />
97+
98+
</template>
99+
100+
<template v-if="specs.product.charging">
101+
102+
## Charging
103+
104+
<DeviceSpecSection :spec="specs" sectionName="charging" />
105+
106+
</template>
107+
108+
<template v-if="specs.product.components">
109+
110+
## Components
111+
112+
<DeviceSpecSection :spec="specs" sectionName="components" />
51113

52114
</template>
53115

devices/pro/index.md

Lines changed: 25 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3,97 +3,93 @@ aside: true
33
---
44

55
<script setup>
6+
import spec from '../../public/device-specs/pro/v2.yaml?raw'
67
import loadSpec from '../../utils/loadSpec'
7-
import { ref, onMounted } from 'vue'
88

9-
const specs = ref(null)
10-
11-
onMounted(async () => {
12-
const res = await fetch('/device-specs/pro/v2.yaml')
13-
const yamlText = await res.text()
14-
specs.value = loadSpec(yamlText).value
15-
})
9+
const specs = loadSpec(spec)
1610
</script>
1711

1812
# Pro (PR2)
1913

20-
<DownloadSpecButton v-if="specs" :spec="specs" deviceTitle="Pro (PR2)" />
14+
<DownloadSpecButton :spec="specs" deviceTitle="Pro (PR2)" />
2115

2216
## Images
2317

24-
<DeviceSpecImages v-if="specs" :spec="specs" />
18+
<DeviceSpecImages :spec="specs" />
2519

2620
## Overview
2721

28-
<DeviceSpecOverview v-if="specs" :spec="specs" />
22+
<DeviceSpecOverview :spec="specs" />
2923

30-
<template v-if="specs && specs.physical">
24+
<template v-if="specs.product.physical">
3125

3226
## Physical
3327

34-
<DeviceSpecSection v-if="specs" :spec="specs" sectionName="physical" />
28+
<DeviceSpecSection :spec="specs" sectionName="physical" />
3529

3630
</template>
3731

38-
<template v-if="specs && specs.integrations">
32+
<template v-if="specs.product.integrations">
3933

4034
## Integrations
4135

42-
<DeviceSpecSection v-if="specs" :spec="specs" sectionName="integrations" />
36+
<DeviceSpecSection :spec="specs" sectionName="integrations" />
4337

4438
</template>
4539

46-
<template v-if="specs && specs['user interface']">
40+
<template v-if="specs.product['user interface']">
4741

4842
## User Interface
4943

50-
<DeviceSpecSection v-if="specs" :spec="specs" sectionName="user interface" />
44+
<DeviceSpecSection :spec="specs" sectionName="user interface" />
5145

5246
</template>
5347

54-
<template v-if="specs && specs.connectivity">
48+
<template v-if="specs.product.connectivity">
5549

5650
## Connectivity
5751

58-
<DeviceSpecSection v-if="specs" :spec="specs" sectionName="connectivity" />
52+
<DeviceSpecSection :spec="specs" sectionName="connectivity" />
5953

6054
</template>
6155

62-
<template v-if="specs && specs.positioning">
56+
<template v-if="specs.product.positioning">
6357

6458
## Positioning
6559

66-
<DeviceSpecSection v-if="specs" :spec="specs" sectionName="positioning" />
60+
<DeviceSpecSection :spec="specs" sectionName="positioning" />
6761

6862
</template>
6963

70-
<template v-if="specs && specs.sensors">
64+
<template v-if="specs.product.sensors">
7165

7266
## Sensors
7367

74-
<DeviceSpecSection v-if="specs" :spec="specs" sectionName="sensors" />
68+
<DeviceSpecSection :spec="specs" sectionName="sensors" />
7569

7670
</template>
7771

78-
<template v-if="specs && specs.battery">
72+
<template v-if="specs.product.battery">
7973

8074
## Battery
8175

82-
<DeviceSpecSection v-if="specs" :spec="specs" sectionName="battery" />
76+
<DeviceSpecSection :spec="specs" sectionName="battery" />
8377

8478
</template>
8579

86-
<template v-if="specs && specs.charging">
80+
<template v-if="specs.product.charging">
8781

8882
## Charging
8983

90-
<DeviceSpecSection v-if="specs" :spec="specs" sectionName="charging" />
84+
<DeviceSpecSection :spec="specs" sectionName="charging" />
9185

9286
</template>
9387

94-
<template v-if="specs && specs.components">
88+
<template v-if="specs.product.components">
89+
90+
## Components
9591

96-
<DeviceSpecSection v-if="specs" :spec="specs" sectionName="components" />
92+
<DeviceSpecSection :spec="specs" sectionName="components" />
9793

9894
</template>
9995

devices/vehicle/index.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,71 +24,71 @@ const specs = loadSpec(spec)
2424

2525
<DeviceSpecOverview :spec="specs" />
2626

27-
<template v-if="specs.physical">
27+
<template v-if="specs.product.physical">
2828

2929
## Physical
3030

3131
<DeviceSpecSection :spec="specs" sectionName="physical" />
3232

3333
</template>
3434

35-
<template v-if="specs.integrations">
35+
<template v-if="specs.product.integrations">
3636

3737
## Integrations
3838

3939
<DeviceSpecSection :spec="specs" sectionName="integrations" />
4040

4141
</template>
4242

43-
<template v-if="specs['user interface']">
43+
<template v-if="specs.product['user interface']">
4444

4545
## User Interface
4646

4747
<DeviceSpecSection :spec="specs" sectionName="user interface" />
4848

4949
</template>
5050

51-
<template v-if="specs.connectivity">
51+
<template v-if="specs.product.connectivity">
5252

5353
## Connectivity
5454

5555
<DeviceSpecSection :spec="specs" sectionName="connectivity" />
5656

5757
</template>
5858

59-
<template v-if="specs.positioning">
59+
<template v-if="specs.product.positioning">
6060

6161
## Positioning
6262

6363
<DeviceSpecSection :spec="specs" sectionName="positioning" />
6464

6565
</template>
6666

67-
<template v-if="specs.sensors">
67+
<template v-if="specs.product.sensors">
6868

6969
## Sensors
7070

7171
<DeviceSpecSection :spec="specs" sectionName="sensors" />
7272

7373
</template>
7474

75-
<template v-if="specs.battery">
75+
<template v-if="specs.product.battery">
7676

7777
## Battery
7878

7979
<DeviceSpecSection :spec="specs" sectionName="battery" />
8080

8181
</template>
8282

83-
<template v-if="specs.charging">
83+
<template v-if="specs.product.charging">
8484

8585
## Charging
8686

8787
<DeviceSpecSection :spec="specs" sectionName="charging" />
8888

8989
</template>
9090

91-
<template v-if="specs.components">
91+
<template v-if="specs.product.components">
9292

9393
## Components
9494

devices/zero/index.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,71 +21,71 @@ const specs = loadSpec(spec)
2121

2222
<DeviceSpecOverview :spec="specs" />
2323

24-
<template v-if="specs.physical">
24+
<template v-if="specs.product.physical">
2525

2626
## Physical
2727

2828
<DeviceSpecSection :spec="specs" sectionName="physical" />
2929

3030
</template>
3131

32-
<template v-if="specs.integrations">
32+
<template v-if="specs.product.integrations">
3333

3434
## Integrations
3535

3636
<DeviceSpecSection :spec="specs" sectionName="integrations" />
3737

3838
</template>
3939

40-
<template v-if="specs['user interface']">
40+
<template v-if="specs.product['user interface']">
4141

4242
## User Interface
4343

4444
<DeviceSpecSection :spec="specs" sectionName="user interface" />
4545

4646
</template>
4747

48-
<template v-if="specs.connectivity">
48+
<template v-if="specs.product.connectivity">
4949

5050
## Connectivity
5151

5252
<DeviceSpecSection :spec="specs" sectionName="connectivity" />
5353

5454
</template>
5555

56-
<template v-if="specs.positioning">
56+
<template v-if="specs.product.positioning">
5757

5858
## Positioning
5959

6060
<DeviceSpecSection :spec="specs" sectionName="positioning" />
6161

6262
</template>
6363

64-
<template v-if="specs.sensors">
64+
<template v-if="specs.product.sensors">
6565

6666
## Sensors
6767

6868
<DeviceSpecSection :spec="specs" sectionName="sensors" />
6969

7070
</template>
7171

72-
<template v-if="specs.battery">
72+
<template v-if="specs.product.battery">
7373

7474
## Battery
7575

7676
<DeviceSpecSection :spec="specs" sectionName="battery" />
7777

7878
</template>
7979

80-
<template v-if="specs.charging">
80+
<template v-if="specs.product.charging">
8181

8282
## Charging
8383

8484
<DeviceSpecSection :spec="specs" sectionName="charging" />
8585

8686
</template>
8787

88-
<template v-if="specs.components">
88+
<template v-if="specs.product.components">
8989

9090
## Components
9191

0 commit comments

Comments
 (0)