소스 검색

use menu helper for quadcopter pages

Thomas Buck 3 년 전
부모
커밋
e2a8550456

+ 1
- 0
input/blog/2015/2015_12_20_serialgamepad.md 파일 보기

@@ -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 파일 보기

@@ -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 파일 보기

@@ -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 파일 보기

@@ -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 파일 보기

@@ -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…
취소
저장