A mirror of my website's source code.

blog posts in sitemap don't have 2 /s anymore

by steve0greatness, Friday, 2 February 2024, 01:18:52 (1706836732), pushed by steve0greatness, Monday, 6 May 2024, 02:55:36 (1714964136)

Author identity: Steve0Greatness <steve0greatnessiscool@gmail.com>

17fc3f4bf125adaad3604d4f85e24a1447fcdcd6

build.py

@@ -157,7 +157,7 @@ def RenderPosts():

                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                    print("Copying blog-posts/%s to %s/blog/%s" % (post["origin"], BUILD_DIRECTORY, post["plaintext"]))
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                    with open(BUILD_DIRECTORY + "/blog/" + post["plaintext"], "w", encoding="utf-8") as PostHTMLFile:
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                        PostHTMLFile.write(post["raw-content"])
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                sitemap.append(SITEMAP_HREF + "/blog/" + post["pathname"])
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                sitemap.append(SITEMAP_HREF + "blog/" + post["pathname"])
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            def RenderPage(PageInput: str, ContentDest: str, AllowSitemap: bool = True, **kwargs):
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                print("Building views/%s to %s/%s" % (PageInput, BUILD_DIRECTORY, ContentDest))
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        

@@ -230,10 +230,8 @@ def main():

                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                print("Building pages")
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                for file, path in PAGES.items():
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                if file in DISALLOWED_SITEMAP:
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                    RenderPage(file, path, False, PostList=PostList)
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                    continue
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                RenderPage(file, path, PostList=PostList)
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                AllowSitemap = file not in DISALLOWED_SITEMAP
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                RenderPage(file, path, AllowSitemap, PostList=PostList)
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                print("Building redirects")
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                for OldLocation, NewLocation in REDIRECTS.items():