Browse Source

use menu helper for quadcopter pages

Thomas Buck 3 years ago
parent
commit
e2a8550456

+ 1
- 0
input/blog/2015/2015_12_20_serialgamepad.md View File

6
 flattr: true
6
 flattr: true
7
 github: https://github.com/xythobuz/SerialGamepad
7
 github: https://github.com/xythobuz/SerialGamepad
8
 parent: projects
8
 parent: projects
9
+show_in_quadcopters: true
9
 position: 50
10
 position: 50
10
 ---
11
 ---
11
 
12
 

+ 1
- 0
input/blog/2016/2016_07_24_usb_host_cppm.md View File

6
 flattr: true
6
 flattr: true
7
 github: https://github.com/xythobuz/Saitek-X52-PPM
7
 github: https://github.com/xythobuz/Saitek-X52-PPM
8
 parent: projects
8
 parent: projects
9
+show_in_quadcopters: true
9
 position: 80
10
 position: 80
10
 ---
11
 ---
11
 
12
 

+ 1
- 0
input/blog/2016/2016_11_05_frsky_telemetry.md View File

6
 flattr: true
6
 flattr: true
7
 github: https://github.com/xythobuz/FrSky-Telemetry-Arduino
7
 github: https://github.com/xythobuz/FrSky-Telemetry-Arduino
8
 parent: projects
8
 parent: projects
9
+show_in_quadcopters: true
9
 position: 90
10
 position: 90
10
 ---
11
 ---
11
 
12
 

+ 6
- 0
input/projects/quadcopters.md View File

13
 <!--%
13
 <!--%
14
 printQuadcopterMenu()
14
 printQuadcopterMenu()
15
 %-->
15
 %-->
16
+
17
+The following projects are also related to my Quadcopter endeavours.
18
+
19
+<!--%
20
+printQuadcopterRelatedMenu()
21
+%-->

+ 6
- 0
macros.py View File

96
     for p in mpages:
96
     for p in mpages:
97
         printMenuItem(p, False, True, True)
97
         printMenuItem(p, False, True, True)
98
 
98
 
99
+def printQuadcopterRelatedMenu():
100
+    mpages = [p for p in pages if p.get("show_in_quadcopters", "false") == "true"]
101
+    mpages.sort(key=lambda p: [p.get("date", "9999-01-01")], reverse = True)
102
+    for p in mpages:
103
+        printMenuItem(p, False, True, True)
104
+
99
 def printRobotMenuEnglish():
105
 def printRobotMenuEnglish():
100
     mpages = [p for p in pages if p.get("parent", "") == "xyrobot" and p.lang == "en"]
106
     mpages = [p for p in pages if p.get("parent", "") == "xyrobot" and p.lang == "en"]
101
     mpages.sort(key=lambda p: int(p["position"]))
107
     mpages.sort(key=lambda p: int(p["position"]))

Loading…
Cancel
Save