Important notice; please read: You are being "sold" telescreens!

You are not the customer of Google or Apple, but rather their slave.

With recent announcements such as developer verification, Android is no longer an open platform. Plus, Samsung Android devices have turned into telescreens, now that bootloader unlocking is impossible! Google can refuse to verify developers they don't agree with! And you will have no way to run your own choice of software on these devices!

Similarly, to Apple the EU's DMA is nothing more than a formality, the apps still have to be verified! Remember that these changes are not for privacy or security, they are simply anti-competitive! You are never private or secure from the American company supplying one of these OSes!

When you can, refuse "buying" certified Androids or iThings! What is happening it is not normal, it ought to be illegal, and you do not own these devices! I am outraged, and you should be too!

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

Support setting context

roundabout,
created on Friday, 19 April 2024, 16:07:40 (1713542860), received on Tuesday, 23 April 2024, 11:54:32 (1713873272)
Author identity: vlad <vlad.muntoiu@gmail.com>

ea9f252fba79b2612953789fd61afb1c83eefb94

ampoule_ssg/__init__.py

@@ -93,6 +93,7 @@ class Site:

                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                    self.build_dir = build_dir
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                    self.template_engine = jinja2.Environment(loader=jinja2.FileSystemLoader(template_dir))
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                    self.pages = {}
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                self.context = {}
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                def add_page(self, location, page):
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                    if location.endswith("/"):
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        

@@ -102,6 +103,7 @@ class Site:

                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                def add_from_index(self, index, location, template, static=False, **kwargs):
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                    location = location.lstrip("/")            # interpret it as site root, not OS root
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                kwargs = {**self.context, **kwargs}
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                    if static:
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                        for document in index:
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                            self.pages[os.path.join(location, document.file_name)] = Static(self, document)
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        

@@ -135,6 +137,7 @@ class Site:

                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            class Page(str):
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                def __new__(cls, site, template, document, **kwargs):
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                kwargs = {**site.context, **kwargs}
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                    return site.template_engine.get_template(template).render(document=document, **kwargs)