add README
This commit is contained in:
		
							parent
							
								
									2c6c575f64
								
							
						
					
					
						commit
						a5cb8878aa
					
				
							
								
								
									
										54
									
								
								README.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										54
									
								
								README.md
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,54 @@
 | 
				
			|||||||
 | 
					# CostaPy Template - Plain
 | 
				
			||||||
 | 
					A plain CostaPy template
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					## Usage
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- Put the folder in your `templates` directory
 | 
				
			||||||
 | 
					- Add to handler
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							import  templates.plain.main	as template_public
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							params["mako"] = {
 | 
				
			||||||
 | 
								"website" : template_public.main(directory.page["public"], "home")
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- Define a necessary variable on your modules
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							title       = "CostaPy"
 | 
				
			||||||
 | 
							header      = "Welcome to CostaPy"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							user_roles  = ["guest"]
 | 
				
			||||||
 | 
							active_page = "Home"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							copyright   = "Copyright (C) 2022 Dita Aji Pratama"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							greeting    = "Lorem ipsum"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- Define a navbar menu on your modules
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							menu = [
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"name":"Home",
 | 
				
			||||||
 | 
									"target":"_self",
 | 
				
			||||||
 | 
									"href":"/",
 | 
				
			||||||
 | 
									"roles":["guest"]
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
							]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- Set a template on your modules
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							return Template(params["mako"]["website"]['index']).render(
 | 
				
			||||||
 | 
								title     = title,
 | 
				
			||||||
 | 
								header    = header,
 | 
				
			||||||
 | 
								navbar    = Template(params["mako"]["website"]['navbar']).render(
 | 
				
			||||||
 | 
									menu        = menu,
 | 
				
			||||||
 | 
									user_roles  = user_roles,
 | 
				
			||||||
 | 
									active_page = active_page
 | 
				
			||||||
 | 
								),
 | 
				
			||||||
 | 
								footer    = Template(params["mako"]["website"]['footer']).render(
 | 
				
			||||||
 | 
									copyright   = copyright,
 | 
				
			||||||
 | 
								),
 | 
				
			||||||
 | 
								container = Template(params["mako"]["website"]['container']).render(
 | 
				
			||||||
 | 
									greeting    = greeting
 | 
				
			||||||
 | 
								)
 | 
				
			||||||
 | 
							)
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user