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

@@ -19,17 +19,21 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.Rawley Fow
import (
"github.com/gin-gonic/gin"
"gitlab.com/rawleyifowler/site-rework/controllers"
"gitlab.com/rawleyifowler/site-rework/utils"
"github.com/rawleyfowler/rawleydotxyz/controllers"
"github.com/rawleyfowler/rawleydotxyz/utils"
)
// Initializes all routes from the controller package
// Initializes all routes from the controller package.
// Uses the ServePage function from utils to generate static route handlers.
func InitializeRoutes(router *gin.Engine) {
// No route will serve the not found page.
router.NoRoute(utils.ServePage("not_found.tmpl"))
// Router groups for dynamic routing and dynamic pages.
blogGroup := router.Group("/blog")
controllers.RegisterBlogGroup(blogGroup)
adminGroup := router.Group("/admin")
controllers.RegisterAdminGroup(adminGroup)
// Static routes that serve the same html every time.
router.GET("/", utils.ServePage("index.tmpl"))
router.GET("/resume", utils.ServePage("resume.tmpl"))
router.GET("/contact", utils.ServePage("contact.tmpl"))