Browse Source

use menu helper for quadcopter pages

Thomas Buck 2 years ago
parent
commit
e2a8550456

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

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

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

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

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

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

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

@@ -13,3 +13,9 @@ Of course I'm not flying illegally, I have a model flight insurance and I am a r
13 13
 <!--%
14 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,6 +96,12 @@ def printQuadcopterMenu():
96 96
     for p in mpages:
97 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 105
 def printRobotMenuEnglish():
100 106
     mpages = [p for p in pages if p.get("parent", "") == "xyrobot" and p.lang == "en"]
101 107
     mpages.sort(key=lambda p: int(p["position"]))

Loading…
Cancel
Save