dev #3
16
main.go
16
main.go
|
@ -14,6 +14,7 @@ type Index struct {
|
|||
WebpageIcon string
|
||||
WebpageKeywords string
|
||||
WebpageDescription string
|
||||
WebpageURL string
|
||||
GalleryItems []GalleryItems
|
||||
SocialItems []SocialItems
|
||||
VideoItems []VideoItems
|
||||
|
@ -22,6 +23,11 @@ type Index struct {
|
|||
Nav bool
|
||||
}
|
||||
|
||||
type responseWriter struct {
|
||||
http.ResponseWriter
|
||||
status int
|
||||
}
|
||||
|
||||
type GalleryItems struct {
|
||||
URL string
|
||||
ID int
|
||||
|
@ -49,6 +55,7 @@ var data = &Index {
|
|||
WebpageIcon: "/src/assets/main/favicon.ico",
|
||||
WebpageKeywords: "keyemail",
|
||||
WebpageDescription: "Welcome to keyemail.dev! A profile based on Keyemail.",
|
||||
WebpageURL: "https://keyemail.dev",
|
||||
GalleryItems: galleryItems,
|
||||
SocialItems: socialItems,
|
||||
VideoItems: videoItems,
|
||||
|
@ -170,19 +177,19 @@ func videoContentHandler(w http.ResponseWriter, req *http.Request) {
|
|||
}
|
||||
|
||||
func videoHandler(w http.ResponseWriter, req *http.Request) {
|
||||
renderTemplate(w, "video", data, true);
|
||||
renderTemplate(w, "video", data, true)
|
||||
}
|
||||
|
||||
func socialsHandler(w http.ResponseWriter, req *http.Request) {
|
||||
renderTemplate(w, "socials", data, true);
|
||||
renderTemplate(w, "socials", data, true)
|
||||
}
|
||||
|
||||
func galleryHandler(w http.ResponseWriter, req *http.Request) {
|
||||
renderTemplate(w, "gallery", data, true);
|
||||
renderTemplate(w, "gallery", data, true)
|
||||
}
|
||||
|
||||
func indexHandler(w http.ResponseWriter, req *http.Request) {
|
||||
renderTemplate(w, "home", data, true);
|
||||
renderTemplate(w, "home", data, true)
|
||||
}
|
||||
|
||||
func main() {
|
||||
|
@ -201,6 +208,7 @@ func main() {
|
|||
http.HandleFunc("/videos", videoHandler)
|
||||
http.HandleFunc("/gallery/", galleryContentHandler)
|
||||
http.HandleFunc("/videos/", videoContentHandler)
|
||||
|
||||
log.Println("Server running at http://localhost" + port)
|
||||
http.ListenAndServe(port, nil)
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<head>
|
||||
{{ define "head" }}
|
||||
<link rel="stylesheet" href="/src/styles/gallery.css">
|
||||
<meta property="og:image" content="https://keyemail.dev/{{ .GalleryPhoto.URL }}"/>
|
||||
<meta property="og:image" content="{{ .WebpageURL }}{{ .GalleryPhoto.URL }}"/>
|
||||
<meta name="twitter:card" content="summary_large_image"/>
|
||||
{{ end }}
|
||||
</head>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<head>
|
||||
{{ define "head" }}
|
||||
<link rel="stylesheet" href="/src/styles/video.css"/>
|
||||
<link property=og:image" content="https://keyemail.dev/{{ .VideoContent.URL }}"/>
|
||||
<meta property="og:image" content="{{ .WebpageURL }}{{ .VideoContent.Thumbnail }}"/>
|
||||
<meta name="twitter:card" content="summary_large_image"/>
|
||||
{{ end }}
|
||||
</head>
|
||||
|
|
Loading…
Reference in a new issue