Browse Source

show some bigger projects from submenus in the main project list as well

Thomas B 20 hours ago
parent
commit
38ed9936ba

+ 1
- 0
input/projects/3d-printing/i3-am8.md View File

@@ -1,6 +1,7 @@
1 1
 title: i3 CoreXZ AM8
2 2
 description: Rebuild of my i3 clone with aluminium extrusions, CoreXZ, Klipper
3 3
 parent: 3d-printing
4
+second_parent: projects
4 5
 position: 10
5 6
 date: 2022-10-08
6 7
 update: 2023-09-03

+ 1
- 0
input/projects/3d-printing/octotray.md View File

@@ -1,6 +1,7 @@
1 1
 title: OctoTray
2 2
 description: PyQt tray application to control OctoPrint/Moonraker
3 3
 parent: 3d-printing
4
+second_parent: projects
4 5
 position: 50
5 6
 comments: true
6 7
 git: https://git.xythobuz.de/thomas/OctoTray

+ 1
- 0
input/projects/input_devices/trackball_v1.md View File

@@ -1,6 +1,7 @@
1 1
 title: Trackball
2 2
 description: 3D printed mouse replacement with Raspberry Pi Pico and PMW3360
3 3
 parent: input_devices
4
+second_parent: projects
4 5
 git: https://git.xythobuz.de/thomas/Trackball
5 6
 github: https://github.com/xythobuz/Trackball
6 7
 date: 2023-02-12

+ 1
- 0
input/projects/smarthome/lora_sml.md View File

@@ -1,6 +1,7 @@
1 1
 title: Smart Meter Bridge
2 2
 description: Reading SML power meter data transmitted via LoRa
3 3
 parent: smarthome
4
+second_parent: projects
4 5
 position: 150
5 6
 git: https://git.xythobuz.de/thomas/esp-env
6 7
 github: https://github.com/xythobuz/esp-env

+ 3
- 3
macros.py View File

@@ -271,7 +271,7 @@ def printBlogMenu(year_min=None, year_max=None):
271 271
     print("</ul>")
272 272
 
273 273
 def printProjectsMenu():
274
-    # prints all pages with parent 'projects' or 'stuff'.
274
+    # prints all pages with parent or second_parent 'projects' or 'stuff'.
275 275
     # first the ones without date, sorted by position.
276 276
     # this first section includes sub-headings for children
277 277
     # in a hidden div, expanding when clicking the description.
@@ -282,7 +282,7 @@ def printProjectsMenu():
282 282
     # select pages without date
283 283
     dpages = [p for p in enpages if p.get("date", "") == ""]
284 284
     # only those that have a parent in ['projects', 'stuff']
285
-    mpages = [p for p in dpages if any(x in p.get("parent", "") for x in [ 'projects', 'stuff' ])]
285
+    mpages = [p for p in dpages if any((x in p.get("parent", "")) or (x in p.get("second_parent", "")) for x in [ 'projects', 'stuff' ])]
286 286
     # sort by position
287 287
     mpages.sort(key=lambda p: [int(p.get("position", "999"))])
288 288
 
@@ -312,7 +312,7 @@ def printProjectsMenu():
312 312
     # slect pages with a date
313 313
     dpages = [p for p in enpages if p.get("date", "") != ""]
314 314
     # only those that have a parent in ['projects', 'stuff']
315
-    mpages = [p for p in dpages if any(x in p.get("parent", "") for x in [ 'projects', 'stuff' ])]
315
+    mpages = [p for p in dpages if any((x in p.get("parent", "")) or (x in p.get("second_parent", "")) for x in [ 'projects', 'stuff' ])]
316 316
     # sort by date
317 317
     mpages.sort(key=lambda p: [p.get("date", "9999-01-01")], reverse = True)
318 318
 

Loading…
Cancel
Save