Routing, templating, and database handling
This commit is contained in:
		
							
								
								
									
										13
									
								
								templates/base.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								templates/base.html
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,13 @@
 | 
			
		||||
<!DOCTYPE html>
 | 
			
		||||
<html lang="en">
 | 
			
		||||
<head>
 | 
			
		||||
    <meta charset="UTF-8">
 | 
			
		||||
    <title>SiteName - {{ template "pageTitle" }}</title>
 | 
			
		||||
</head>
 | 
			
		||||
<body>
 | 
			
		||||
{{ template "content" . }}
 | 
			
		||||
</body>
 | 
			
		||||
<footer>
 | 
			
		||||
    <p>SiteName - Powered by Go!</p>
 | 
			
		||||
</footer>
 | 
			
		||||
</html>
 | 
			
		||||
							
								
								
									
										5
									
								
								templates/pages/home.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								templates/pages/home.html
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,5 @@
 | 
			
		||||
{{ define "pageTitle" }}Home{{ end }}
 | 
			
		||||
 | 
			
		||||
{{ define "content" }}
 | 
			
		||||
{{ .Test }}
 | 
			
		||||
{{ end }}
 | 
			
		||||
							
								
								
									
										11
									
								
								templates/pages/login.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								templates/pages/login.html
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,11 @@
 | 
			
		||||
{{ define "pageTitle" }}Login{{ end }}
 | 
			
		||||
 | 
			
		||||
{{ define "content" }}
 | 
			
		||||
<form action="/login-handle" method="post">
 | 
			
		||||
    <label for="username">Username:</label><br>
 | 
			
		||||
    <input type="text" id="username" name="username" value="John"><br><br>
 | 
			
		||||
    <label for="password">Password:</label><br>
 | 
			
		||||
    <input type="password" id="password" name="password"><br><br>
 | 
			
		||||
    <input type="submit" value="Submit">
 | 
			
		||||
</form>
 | 
			
		||||
{{ end }}
 | 
			
		||||
							
								
								
									
										11
									
								
								templates/pages/register.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								templates/pages/register.html
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,11 @@
 | 
			
		||||
{{ define "pageTitle" }}Register{{ end }}
 | 
			
		||||
 | 
			
		||||
{{ define "content" }}
 | 
			
		||||
<form action="/register-handle" method="post">
 | 
			
		||||
    <label for="username">Username:</label><br>
 | 
			
		||||
    <input type="text" id="username" name="username" value="John"><br><br>
 | 
			
		||||
    <label for="password">Password:</label><br>
 | 
			
		||||
    <input type="password" id="password" name="password"><br><br>
 | 
			
		||||
    <input type="submit" value="Submit">
 | 
			
		||||
</form>
 | 
			
		||||
{{ end }}
 | 
			
		||||
		Reference in New Issue
	
	Block a user