added comments, updated go.mod to reflect new repo

This commit is contained in:
2022-04-30 11:07:14 -06:00
parent 62b614a790
commit 95b1822a7b
9 changed files with 25 additions and 15 deletions

View File

@@ -22,6 +22,8 @@ import (
"os"
)
// Loads the api key from a local file given by path.
// This api key is used to make admins.
func LoadApiKey(path string) string {
file, err := os.Open(path)
if err != nil {

View File

@@ -24,6 +24,11 @@ import (
"github.com/gin-gonic/gin"
)
// Serves a static page, based on its name.
// Returns a handler func that renders a given page.
// Page input t should always be <Page Name>.tmpl
// Also sets the title for the page if it allows for dyanmic titles.
// index.tmpl will have an empty title.
func ServePage(t string) gin.HandlerFunc {
title := strings.Split(t, ".")[0]
if title == "index" {