A mirror of my website's source code.

Important information: Google announced that, from September 2026, Android devices will require ALL apps to be signed by Google, effectively leading to an iOS situation. Value your right to a computer that does what you want; do not tolerate this monopolistic practice! Contact me if you don't understand why it is bad. Click to learn more.

Basis for Posted Creator and editor

by steve0greatness, Monday, 22 January 2024, 00:02:43 (1705881763), pushed by steve0greatness, Monday, 6 May 2024, 02:55:35 (1714964135)

Author identity: Steve0Greatness <75220768+Steve0Greatness@users.noreply.github.com>

dfc58d693116b031edceaeb06c57d127351e3091

build.py

@@ -68,6 +68,8 @@ def GetBlogList():

                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                        if "updated" in Item:
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                            Item["atom-update-time"] = PostDateToDateObj(Item["updated"]).strftime("%Y-%m-%d") + "T00:00:00Z"
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                        Item["pathname"] = slug.replace(".md", ".html")
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                    Item["plaintext"] = slug.replace(".md", ".txt")
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                    Item["origin"] = slug
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                        Posts.append(Item)
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                PostsByDate = sorted(Posts, key=PostSortHelper, reverse=True)
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                return PostsByDate
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                            
                                

dev-server.py

@@ -1,4 +1,4 @@

                                
                                
                                
                            
                                
                                    
                                        
                                        from build import main as BuildStaticSite
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        from build import main as BuildStaticSite, PostList
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            from flask import Flask, redirect
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            app = Flask(__name__)
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        

@@ -7,6 +7,22 @@ app = Flask(__name__)

                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            def Index():
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                return """<a href="/build">Rebuild site</a>"""
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        @app.route("/blog-list")
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        def Writer():
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            BlogListHTML = "<br/>".join(("<a href=\"/edit/%s\">%s</a>" % (post["origin"], post["title"]) for post in PostList))
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            return """<a href="/new-post">+</a><hr/>%(listing)s""" % { "listing": BlogListHTML }
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        @app.route("/edit/<post>")
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        def Editor(post: str):
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            BlogListDict = { PostObj["origin"]: PostObj for PostObj in PostList }
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            if post not in BlogListDict:
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                return redirect("/")
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            return """"""
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        @app.route("/new-post")
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        def NewPost():
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            return """"""
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            @app.route("/build")
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            def Builder():
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                BuildStaticSite()