A mirror of my website's source code.

Skip blog post file if it is not a markdown file

by steve0greatness, Wednesday, 7 February 2024, 07:49:58 (1707292198), pushed by steve0greatness, Monday, 6 May 2024, 02:55:38 (1714964138)

Author identity: Steve0Greatness <steve0greatnessiscool@gmail.com>

2576ce89b3a8e38afa667c49b980a40ad40045fc

build.py

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

                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                    PostSlugs = PostSlugs + tuple( ("drafts", file) for file in ListDirectory("drafts") )
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                Posts = []
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                for dir, slug in PostSlugs:
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                if not slug.endswith(".md"):
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                    continue
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                    print("Grabbing post list blog-posts/%s" % (slug))
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                    with open(dir + "/" + slug, encoding="utf-8") as MDFile:
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                        RawMD = MDFile.read()
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        

@@ -259,4 +261,4 @@ def main():

                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                    SitemapFile.write("\n".join(sitemap))
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            if __name__ == "__main__":
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            main()
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            main()