feat: linkedin

This commit is contained in:
ange 2024-12-21 11:13:23 +00:00
parent 186491250e
commit 08557f45db
Signed by: ange
GPG key ID: 9E0C4157BB7BEB1D
11 changed files with 53 additions and 24 deletions

View file

@ -1,23 +1,26 @@
package main
import (
"path/filepath"
"net/http"
"fmt"
)
func index(w http.ResponseWriter, r *http.Request) {
http.Redirect(w, r, "/contact", http.StatusMovedPermanently)
}
func style(w http.ResponseWriter, r *http.Request) {
http.ServeFile(w, r, "html/style.css")
}
func static(w http.ResponseWriter, r *http.Request) {
http.ServeFile(w, r, r.URL.Path)
}
func css(w http.ResponseWriter, r *http.Request) {
fmt.Println(filepath.Join("css", getParam(r, 0)))
http.ServeFile(w, r, filepath.Join("css", getParam(r, 0)))
}
func html(w http.ResponseWriter, r *http.Request) {
if t, found := TMPL[r.URL.Path]; found {
if t, found := TMPL[getParam(r, 0)]; found {
w.Write(t)
} else {
http.NotFound(w, r)