Browse Source

show new pages and updates on homepage. add date to 3d printer articles.

Thomas Buck 3 years ago
parent
commit
a5c14b1a15

+ 1
- 1
input/index.md View File

35
 
35
 
36
 To receive my latest updates, you can subscribe to the <a href="rss.xml"><img src="img/rss.png">RSS Feed</a>.
36
 To receive my latest updates, you can subscribe to the <a href="rss.xml"><img src="img/rss.png">RSS Feed</a>.
37
 
37
 
38
-### Recent Posts
38
+### Recent Posts and Updates
39
 
39
 
40
 <!--%
40
 <!--%
41
 printRecentMenu()
41
 printRecentMenu()

+ 2
- 0
input/projects/3d-printing/ctc-i3.md View File

2
 description: Experiences with and modifications to my chinese Prusa i3 clone
2
 description: Experiences with and modifications to my chinese Prusa i3 clone
3
 parent: 3d-printing
3
 parent: 3d-printing
4
 position: 20
4
 position: 20
5
+date: 2017-11-01
6
+update: 2022-01-27
5
 comments: true
7
 comments: true
6
 ---
8
 ---
7
 
9
 

+ 2
- 0
input/projects/3d-printing/fabrikator-mini.md View File

2
 description: My modifications for the TinyBoy Fabrikator Mini
2
 description: My modifications for the TinyBoy Fabrikator Mini
3
 parent: 3d-printing
3
 parent: 3d-printing
4
 position: 10
4
 position: 10
5
+date: 2016-03-01
6
+update: 2022-01-27
5
 comments: true
7
 comments: true
6
 ---
8
 ---
7
 
9
 

+ 2
- 0
input/projects/3d-printing/octoprint.md View File

2
 description: Setting up OctoPrint and some common improvements
2
 description: Setting up OctoPrint and some common improvements
3
 parent: 3d-printing
3
 parent: 3d-printing
4
 position: 40
4
 position: 40
5
+date: 2019-09-08
6
+update: 2022-01-24
5
 comments: true
7
 comments: true
6
 ---
8
 ---
7
 
9
 

+ 2
- 2
macros.py View File

101
                 dateto = " (%s - %s)" % (year, p.get("update", "")[0:4])
101
                 dateto = " (%s - %s)" % (year, p.get("update", "")[0:4])
102
 
102
 
103
         if nicelyFormatFullDate:
103
         if nicelyFormatFullDate:
104
-            dateto = " - " + datetime.strptime(p.date, "%Y-%m-%d").strftime("%B %d, %Y")
104
+            dateto = " - " + datetime.strptime(p.get("update", p.date), "%Y-%m-%d").strftime("%B %d, %Y")
105
 
105
 
106
     print "  * **[%s](%s)**%s" % (title, p.url, dateto)
106
     print "  * **[%s](%s)**%s" % (title, p.url, dateto)
107
 
107
 
116
 
116
 
117
 def printRecentMenu(count = 5):
117
 def printRecentMenu(count = 5):
118
     posts = [p for p in pages if "date" in p]
118
     posts = [p for p in pages if "date" in p]
119
-    posts.sort(key=lambda p: p.get("date"), reverse=True)
119
+    posts.sort(key=lambda p: p.get("update", p.get("date")), reverse=True)
120
     for p in posts[0:count]:
120
     for p in posts[0:count]:
121
         printMenuItem(p, False, False, False, True)
121
         printMenuItem(p, False, False, False, True)
122
 
122
 

Loading…
Cancel
Save