A mirror of my website's source code.

By using this site, you agree to have cookies stored on your device, strictly for functional purposes, such as storing your session and preferences.

Dismiss

Use sets and dicts instead of lists and tuples for global constants without a need for order.

steve0greatness,
created on Saturday, 27 January 2024, 01:40:43 (1706319643), received on Monday, 6 May 2024, 02:55:36 (1714964136)
Author identity: Steve0Greatness <75220768+Steve0Greatness@users.noreply.github.com>

95e2a278a1ad6dbcfb8e4daf15924110b5282ef6

build.py

@@ -22,15 +22,15 @@ PAGES = {

                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                "404.html": "404.html"
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            }
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        DISALLOWED_SITEMAP = [
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        DISALLOWED_SITEMAP = {
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                "404.html",
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                "blog-feed.rss",
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                "blog-feed.atom",
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        ]
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        }
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        REDIRECTS = [
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            ("link-tree.html", "list/link-tree.html") # Old location -> new location
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        ]
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        REDIRECTS = {
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            "link-tree.html": "list/link-tree.html", # Old location -> new location
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        }
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            SITEMAP_HREF = "https://steve0greatness.github.io/"
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            sitemap = []
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        

@@ -236,7 +236,7 @@ def main():

                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                    RenderPage(file, path, PostList=PostList)
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                print("Building redirects")
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            for OldLocation, NewLocation in REDIRECTS:
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            for OldLocation, NewLocation in REDIRECTS.items():
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                    RenderPage("redirect.html", OldLocation, False, redirect=NewLocation)
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                with open(BUILD_DIRECTORY + "/sitemap.txt", "w") as SitemapFile: