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

Give list pages breadcrumbs

steve0greatness,
created on Saturday, 20 January 2024, 06:33:55 (1705732435), received on Monday, 6 May 2024, 02:55:35 (1714964135)
Author identity: Steve0Greatness <75220768+Steve0Greatness@users.noreply.github.com>

59dd2cdd3db411770549447c66c73ee052b3f43b

build.py

@@ -191,7 +191,7 @@ def RenderLists():

                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                    Title = List["title"]
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                    print("%s -> %s" % ("lists/" + List["filename"], BUILD_DIRECTORY + FileLocation))
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                    with open(BUILD_DIRECTORY + FileLocation, "w") as file:
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                    file.write(RenderTemplate("list.html", Content=List["content"], Title=Title))
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                    file.write(RenderTemplate("list.html", Content=List["content"], Title=Title, Location=FileLocation))
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                    ListIndex += "<li><a href=\"%s\">%s</a></li>" % (FileLocation, Title)
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                ListIndex += "</ul>"
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                print("Building list index")
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                            
                                

views/list.html

@@ -4,6 +4,8 @@

                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            <link rel="stylesheet" href="/src/code-blocks.css" />
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            {% endblock %}
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            {% block title %}{{Title}}{% endblock %}
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        {% from "_macros.html" import GenerateBreadcrumbs %}
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        {% block breadcrumbs %}{{ GenerateBreadcrumbs([{ "href": "/list", "title": "List Index" }, { "href": "/list/" + Location, "title": Title }]) }}{% endblock %}
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            {% block content %}
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            <h1>{{Title}}</h1>
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            {{ Content }}