3 次代码提交

作者 SHA1 备注 提交日期
  Thomas Buck 40ff4481a6 put updates to existing pages in rss feed 1年前
  Thomas Buck 4172628ee6 add ammo charger to rc equipment. 1年前
  Thomas Buck b09b38e65c add pics to lx5 page 1年前

+ 5
- 5
input/projects/quadcopters/flying_wing.md 查看文件

@@ -12,11 +12,11 @@ So I decided to build a very simple FPV V-Tail Flying Wing model airplane.
12 12
 
13 13
 <!--%
14 14
 lightgallery([
15
-    [ "img/flying_wing_1.jpg", "" ],
16
-    [ "img/flying_wing_2.jpg", "" ],
17
-    [ "img/flying_wing_3.jpg", "" ],
18
-    [ "img/flying_wing_4.jpg", "" ],
19
-    [ "img/flying_wing_5.jpg", "" ]
15
+    [ "img/flying_wing_1.jpg", "Complete top view" ],
16
+    [ "img/flying_wing_2.jpg", "Closer view of electronics" ],
17
+    [ "img/flying_wing_3.jpg", "Closer view of Rx" ],
18
+    [ "img/flying_wing_4.jpg", "Brace for flaps" ],
19
+    [ "img/flying_wing_5.jpg", "Bottom view" ]
20 20
 ])
21 21
 %-->
22 22
 

+ 10
- 1
input/projects/quadcopters/lx5.md 查看文件

@@ -3,6 +3,7 @@ description: 4S LiPo, 220mm frame, 2205 2300KV motors
3 3
 parent: quadcopters
4 4
 position: 10
5 5
 date: 2017-11-01
6
+update: 2022-05-23
6 7
 ---
7 8
 
8 9
 <!--% backToParent() %-->
@@ -12,8 +13,16 @@ After my first failed attempts with large copters, gaining some experience with
12 13
 But I had built up some skills and was ready for the next step.
13 14
 So I built a 220mm frame copter with 2205 motors.
14 15
 
16
+It has all the bells-and-whistles available at the time, like DShot, Betaflight OSD, Smartaudio, as well as S-Bus and Smartport for two-way communication.
17
+
15 18
 <!--%
16
-# TODO photos
19
+lightgallery([
20
+    [ "img/lx5_3.jpg", "Front view" ],
21
+    [ "img/lx5_1.jpg", "Left side view" ],
22
+    [ "img/lx5_2.jpg", "Right side view" ],
23
+    [ "img/lx5_4.jpg", "Left stack closeup view" ],
24
+    [ "img/lx5_5.jpg", "Right stack closeup view" ]
25
+])
17 26
 %-->
18 27
 
19 28
 Here are some recordings of the FPV footage.

+ 28
- 4
input/projects/quadcopters/rc_equipment.md 查看文件

@@ -3,7 +3,7 @@ description: My gear and the modifications I did to it
3 3
 parent: quadcopters
4 4
 position: 80
5 5
 date: 2015-10-09
6
-update: 2021-05-28
6
+update: 2022-05-23
7 7
 ---
8 8
 
9 9
 <!--% backToParent() %-->
@@ -50,9 +50,14 @@ lightgallery([
50 50
 
51 51
 ## Customized Transmitter
52 52
 
53
+Many years ago, a long time before I even started getting into Quadcopters, my grandpa bought me a cheap 2.4GHz Transmitter from Conrad Elektronik.
54
+Because this was already available when I started building my own copters, I used it for that as well.
55
+Turns out, it is a Flysky-clone, with it's own shoddy PC software.
56
+So I wrote [my own Mac driver for it](2015_12_20_serialgamepad.html).
57
+After using it with its original receiver for a while, I decided to move into the FrSky ecosystem.
58
+So I swapped out the built-in transmitter for a [FrSky DHT](https://www.frsky-rc.com/product/dht-toggle-switch-2/) with the [TTL mod](http://majek.mamy.to/en/frsky-dht-ttl-mod/) to connect [my own telemetry display](2016_11_05_frsky_telemetry.html).
53 59
 
54
-
55
-Also see [the article about my Arduino FrSky Telemetry display](2016_11_05_frsky_telemetry.html) and [the article about my Saitek X52 USB joystick experiments](2016_07_24_usb_host_cppm.html).
60
+Also see [the article about my Saitek X52 USB joystick experiments](2016_07_24_usb_host_cppm.html).
56 61
 
57 62
 <!--%
58 63
 lightgallery([
@@ -67,11 +72,30 @@ lightgallery([
67 72
 ])
68 73
 %-->
69 74
 
70
-## FPV Monitor
75
+## Ammo Can Battery Charging
76
+
77
+Having so many high-capacity LiPo batteries around because of this hobby is kinda scary of course, after looking at a bunch of battery fires on YouTube.
78
+So I at least wanted to have some kind of fire-proof enclosure for charging my batteries in.
79
+I decided to go the common ammo-can route for this.
71 80
 
81
+When doing this, it is **very important** to modify the can so it no longer is pressure-tight.
82
+Otherwise you're building something more like a bomb.
83
+Many people remove the seal in the lid for this, but I decided to drill a couple of large holes into the can, as well as a rectangular cutout for the charging cables.
72 84
 
85
+The holes have a piece of mesh glued in front of them, to keep debris out.
86
+And the inner walls of the can have been padded with cardboard, to prevent any chance of short-circuiting on the metal sheet of the can.
87
+
88
+<!--%
89
+lightgallery([
90
+    [ "img/ammo_charger_1.jpg", "Front of can, with IMAX B5 charger clone" ],
91
+    [ "img/ammo_charger_2.jpg", "Inside of can" ],
92
+    [ "img/ammo_charger_3.jpg", "Side of can" ],
93
+])
94
+%-->
73 95
 
74 96
 <!--%
97
+## FPV Monitor
98
+
75 99
 # TODO photos
76 100
 %-->
77 101
 

+ 41
- 5
macros.py 查看文件

@@ -306,6 +306,10 @@ def printLatestRelease(user, repo):
306 306
 # preconvert hooks
307 307
 # -----------------------------------------------------------------------------
308 308
 
309
+# -----------------------------------------------------------------------------
310
+# multi language support
311
+# -----------------------------------------------------------------------------
312
+
309 313
 def hook_preconvert_anotherlang():
310 314
     MKD_PATT = r'\.(?:md|mkd|mdown|markdown)$'
311 315
     _re_lang = re.compile(r'^[\s+]?lang[\s+]?[:=]((?:.|\n )*)', re.MULTILINE)
@@ -356,7 +360,9 @@ def hook_preconvert_anotherlang():
356 360
 
357 361
     pages[:] = vpages
358 362
 
359
-
363
+# -----------------------------------------------------------------------------
364
+# compatibility redirect for old website URLs
365
+# -----------------------------------------------------------------------------
360 366
 
361 367
 _COMPAT = """        case "%s":
362 368
             $loc = "%s/%s";
@@ -399,7 +405,9 @@ def hook_preconvert_compat():
399 405
     fp.write("?>")
400 406
     fp.close()
401 407
 
402
-
408
+# -----------------------------------------------------------------------------
409
+# sitemap generation
410
+# -----------------------------------------------------------------------------
403 411
 
404 412
 _SITEMAP = """<?xml version="1.0" encoding="UTF-8"?>
405 413
 <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
@@ -431,6 +439,10 @@ def hook_preconvert_sitemap():
431 439
 # postconvert hooks
432 440
 # -----------------------------------------------------------------------------
433 441
 
442
+# -----------------------------------------------------------------------------
443
+# rss feed generation
444
+# -----------------------------------------------------------------------------
445
+
434 446
 _RSS = """<?xml version="1.0"?>
435 447
 <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
436 448
 <channel>
@@ -443,6 +455,7 @@ _RSS = """<?xml version="1.0"?>
443 455
 <lastBuildDate>%s</lastBuildDate>
444 456
 <docs>http://blogs.law.harvard.edu/tech/rss</docs>
445 457
 <generator>Poole</generator>
458
+<ttl>720</ttl>
446 459
 %s
447 460
 </channel>
448 461
 </rss>
@@ -454,28 +467,43 @@ _RSS_ITEM = """
454 467
     <link>%s</link>
455 468
     <description>%s</description>
456 469
     <pubDate>%s</pubDate>
470
+    <atom:updated>%s</atom:updated>
457 471
     <guid>%s</guid>
458 472
 </item>
459 473
 """
460 474
 
461 475
 def hook_postconvert_rss():
462 476
     items = []
477
+
478
+    # all pages with "date" get put into feed
463 479
     posts = [p for p in pages if "date" in p]
464
-    posts.sort(key=lambda p: p.date, reverse=True)
465
-    posts = posts[:10]
480
+
481
+    # sort by update if available, date else
482
+    posts.sort(key=lambda p: p.get("update", p.date), reverse=True)
483
+
484
+    # only put 20 most recent items in feed
485
+    posts = posts[:20]
486
+
466 487
     for p in posts:
467 488
         title = p.title
468 489
         if "post" in p:
469 490
             title = p.post
491
+
470 492
         link = "%s/%s" % (BASE_URL, p.url)
493
+
471 494
         desc = p.html.replace("href=\"img", "%s%s%s" % ("href=\"", BASE_URL, "/img"))
472 495
         desc = desc.replace("src=\"img", "%s%s%s" % ("src=\"", BASE_URL, "/img"))
473 496
         desc = desc.replace("href=\"/img", "%s%s%s" % ("href=\"", BASE_URL, "/img"))
474 497
         desc = desc.replace("src=\"/img", "%s%s%s" % ("src=\"", BASE_URL, "/img"))
475 498
         desc = htmlspecialchars(desc)
499
+
476 500
         date = time.mktime(time.strptime("%s 12" % p.date, "%Y-%m-%d %H"))
477 501
         date = email.utils.formatdate(date)
478
-        items.append(_RSS_ITEM % (title, link, desc, date, link))
502
+
503
+        update = time.mktime(time.strptime("%s 12" % p.get("update", p.date), "%Y-%m-%d %H"))
504
+        update = email.utils.formatdate(update)
505
+
506
+        items.append(_RSS_ITEM % (title, link, desc, date, update, link))
479 507
 
480 508
     items = "".join(items)
481 509
 
@@ -491,6 +519,10 @@ def hook_postconvert_rss():
491 519
     fp.write(rss)
492 520
     fp.close()
493 521
 
522
+# -----------------------------------------------------------------------------
523
+# compatibility redirect for old mobile pages
524
+# -----------------------------------------------------------------------------
525
+
494 526
 _COMPAT_MOB = """        case "%s":
495 527
             $loc = "%s/%s";
496 528
             break;
@@ -535,6 +567,10 @@ def hook_postconvert_mobilecompat():
535 567
     fp.write("?>")
536 568
     fp.close()
537 569
 
570
+# -----------------------------------------------------------------------------
571
+# displaying filesize for download links
572
+# -----------------------------------------------------------------------------
573
+
538 574
 def hook_postconvert_size():
539 575
     file_ext = '|'.join(['pdf', 'zip', 'rar', 'ods', 'odt', 'odp', 'doc', 'xls', 'ppt', 'docx', 'xlsx', 'pptx', 'exe', 'brd', 'plist'])
540 576
     def matched_link(matchobj):

二进制
static/img/ammo_charger_1.jpg 查看文件


二进制
static/img/ammo_charger_1_small.jpg 查看文件


二进制
static/img/ammo_charger_2.jpg 查看文件


二进制
static/img/ammo_charger_2_small.jpg 查看文件


二进制
static/img/ammo_charger_3.jpg 查看文件


二进制
static/img/ammo_charger_3_small.jpg 查看文件


二进制
static/img/lx5_1.jpg 查看文件


二进制
static/img/lx5_1_small.jpg 查看文件


二进制
static/img/lx5_2.jpg 查看文件


二进制
static/img/lx5_2_small.jpg 查看文件


二进制
static/img/lx5_3.jpg 查看文件


二进制
static/img/lx5_3_small.jpg 查看文件


二进制
static/img/lx5_4.jpg 查看文件


二进制
static/img/lx5_4_small.jpg 查看文件


二进制
static/img/lx5_5.jpg 查看文件


二进制
static/img/lx5_5_small.jpg 查看文件


正在加载...
取消
保存