<commit_before>package main

import (
	"html/template"
	"log"
	"net/http"
	"psychic-rat/api"
)

type variables struct {
	Username string
	Items    []api.ItemElement
}

func renderPage(writer http.ResponseWriter, templateName string, variables interface{}) {
	tpt := template.Must(template.New(templateName).ParseFiles(templateName, "header.html.tmpl", "footer.html.tmpl"))
	//tpt.ExecuteTemplate(writer, "header.html", variables)
	tpt.Execute(writer, variables)
	//tpt.ExecuteTemplate(writer, "footer.html", variables)
}

func HomePageHandler(writer http.ResponseWriter, request *http.Request) {
	vars := variables{Username: "Kevin"}
	renderPage(writer, "home.html.tmpl", vars)
}

func SignInPageHandler(writer http.ResponseWriter, request *http.Request) {
	vars := variables{Username: "Kevin"}
	renderPage(writer, "signin.html.tmpl", vars)
}

func PledgePageHandler(writer http.ResponseWriter, request *http.Request) {
	report, err := itemApi.ListItems()
	if err != nil {
		log.Fatal(err)
	}

	vars := variables{Username: "Kevin", Items: report.Items}<commit_msg>Render<commit_after>package main

import (
	"html/template"
	"log"
	"net/http"
	"psychic-rat/api"
)

type variables struct {
	Username string
	Items    []api.ItemElement
}

func HomePageHandler(writer http.ResponseWriter, request *http.Request) {
	vars := variables{Username: "Kevin"}
	renderPage(writer, "home.html.tmpl", vars)
}

func renderPage(writer http.ResponseWriter, templateName string, variables interface{}) {
	tpt := template.Must(template.New(templateName).ParseFiles(templateName, "header.html.tmpl", "footer.html.tmpl"))
	tpt.Execute(writer, variables)
}

func SignInPageHandler(writer http.ResponseWriter, request *http.Request) {
	vars := variables{Username: "Kevin"}
	renderPage(writer, "signin.html.tmpl", vars)
}

func PledgePageHandler(writer http.ResponseWriter, request *http.Request) {
	report, err := itemApi.ListItems()
	if err != nil {
		log.Fatal(err)
	}

	vars := variables{Username: "Kevin", Items: report.Items}
{'fraction_non_alphanumeric': 0.14150473343298456, 'fraction_numerical': 0.0, 'mean_word_length': 5.806779661016949, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6771557', 'n_tokens_mistral': 667, 'n_tokens_neox': 649, 'n_words': 137}