diff --git a/go.mod b/go.mod index 211a1b9..bf258cc 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,3 @@ -module ssg +module personal-website -go 1.26.4 +go 1.27.0 diff --git a/src/main.go b/src/main.go deleted file mode 100644 index 1f9e323..0000000 --- a/src/main.go +++ /dev/null @@ -1,15 +0,0 @@ -package main - -import ( - "fmt" - "net/http" -) - -const PORT = 3333 - -func main() { - mux := http.NewServeMux() - - fmt.Printf("Serving website on http://localhost:%v\n", PORT) - http.ListenAndServe(fmt.Sprintf(":%v", PORT), mux) -} diff --git a/src/templating.go b/src/templating.go deleted file mode 100644 index b196d8a..0000000 --- a/src/templating.go +++ /dev/null @@ -1,43 +0,0 @@ -package main - -import ( - "html/template" - "os" - "path/filepath" - "strings" -) - -var FuncMap = template.FuncMap{ - "funcHere": nil, // todo -} - -// Source: https://stackoverflow.com/a/50581032 (with modifications) | License: CC BY-SA 4.0 -func findAndParseTemplates(rootDir string, funcMap template.FuncMap) (*template.Template, error) { - cleanRoot := filepath.Clean(rootDir) - pfx := len(cleanRoot) + 1 - root := template.Must(template.New("").Funcs(FuncMap), nil) - - err := filepath.Walk(cleanRoot, func(path string, info os.FileInfo, e1 error) error { - if !info.IsDir() && strings.HasSuffix(path, ".html") { - if e1 != nil { - return e1 - } - - b, e2 := os.ReadFile(path) - if e2 != nil { - return e2 - } - - name := path[pfx:] - t := root.New(name).Funcs(funcMap) - _, e2 = t.Parse(string(b)) - if e2 != nil { - return e2 - } - } - - return nil - }) - - return root, err -}