Compare commits
No commits in common. "55c6a3504229f04eb1d842686ffb06b714afbe06" and "d7cb0d06f4225f8b088cdee5ac301e1fd37dbc2b" have entirely different histories.
55c6a35042
...
d7cb0d06f4
@ -14,7 +14,7 @@ func RootHandler(w http.ResponseWriter, r *http.Request) {
|
||||
Title: "Home Page",
|
||||
}
|
||||
|
||||
tmpl, err := template.ParseFiles("web/views/#layout.html", "web/views/index.html", "web/views/#header.html")
|
||||
tmpl, err := template.ParseFiles("web/views/#layout.html", "web/views/index.html")
|
||||
if err != nil {
|
||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 612 KiB After Width: | Height: | Size: 66 KiB |
BIN
web/static/img/globe.png
Normal file
BIN
web/static/img/globe.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 44 KiB |
Binary file not shown.
Before Width: | Height: | Size: 76 KiB |
@ -1,7 +0,0 @@
|
||||
{{define "header"}}
|
||||
<header>
|
||||
<h1 class="mt-8 mb-8 text-3xl font-bold text-blue-400">
|
||||
Welcome to My GO Web App Framework {{.Title}}
|
||||
</h1>
|
||||
</header>
|
||||
{{end}}
|
@ -10,7 +10,6 @@
|
||||
<script src="/static/htmx.min.js"></script>
|
||||
</head>
|
||||
<body class="text-center text-blue-300 bg-gray-800">
|
||||
{{template "header" .}}
|
||||
{{template "view" .}}
|
||||
</body>
|
||||
</html>
|
||||
|
@ -8,7 +8,7 @@
|
||||
<main>
|
||||
<section>
|
||||
<h1 class="font-bold">Serve Static Files Like this Globe</h1>
|
||||
<img src="/static/img/gopher.png" alt="alternate text">
|
||||
<img src="/static/img/globe.png" alt="alternate text">
|
||||
</main>
|
||||
|
||||
<footer>
|
||||
|
@ -1,4 +1,10 @@
|
||||
{{define "view"}}
|
||||
<header>
|
||||
<h1 class="mt-8 mb-8 text-3xl font-bold text-blue-400">
|
||||
Welcome to My GO Web App Framework {{.Title}}
|
||||
</h1>
|
||||
</header>
|
||||
|
||||
<main>
|
||||
<section>
|
||||
<button hx-get="/api/example" class="p-2 text-white bg-blue-400 rounded-md">
|
||||
|
Loading…
Reference in New Issue
Block a user