diff --git a/.gitignore b/.gitignore
index a0ce617..cb30b01 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
+static/
.env
.hugo_build.lock
build
@@ -7,4 +8,4 @@ themes/ananke
bin/build
bin/develop
resources/_gen/
-static/htmx.js
+
diff --git a/bin/fetch-deps.sh b/bin/fetch-deps.sh
index c10bd5b..b3384a6 100755
--- a/bin/fetch-deps.sh
+++ b/bin/fetch-deps.sh
@@ -2,7 +2,12 @@
HTMX_VERSION=1.9.2
+mkdir -p static/img
+
curl -sL "https://unpkg.com/htmx.org@$HTMX_VERSION" > static/htmx.js
curl -sL "https://unpkg.com/htmx.org/dist/ext/remove-me.js" > static/remove-me.js
-echo '' >> layouts/partials/extended_head.html
+curl -sL "https://htmx.org/img/bars.svg" > static/img/bars.svg
+
+echo '' > layouts/partials/extended_head.html
echo '' >> layouts/partials/extended_head.html
+echo "" >> layouts/partials/extended_head.html
diff --git a/content/users/login.md b/content/users/login.md
index 6e6aca3..eb6c036 100644
--- a/content/users/login.md
+++ b/content/users/login.md
@@ -1,21 +1,21 @@
---
title: Log in
---
-
{{< html.inline >}}
diff --git a/layouts/partials/extended_head.html b/layouts/partials/extended_head.html
index e9fa910..ff7946b 100644
--- a/layouts/partials/extended_head.html
+++ b/layouts/partials/extended_head.html
@@ -1,4 +1,3 @@
-
-
+
diff --git a/server.go b/server.go
index 81cf300..ee2b8ed 100644
--- a/server.go
+++ b/server.go
@@ -113,11 +113,11 @@ func init() {
sessionStore = pgxstore.New(db)
sessions.Cookie.Name = "session_id"
- //sessions.Cookie.Domain = siteDomain()
- //sessions.Cookie.HttpOnly = true
- //sessions.Cookie.Persist = true
+ sessions.Cookie.Domain = siteDomain()
+ sessions.Cookie.HttpOnly = true
+ sessions.Cookie.Persist = true
sessions.Cookie.SameSite = http.SameSiteNoneMode
- //sessions.Cookie.Secure = true
+ sessions.Cookie.Secure = true
sessions.Store = sessionStore
ctx := context.Background()
@@ -144,7 +144,7 @@ func main() {
defer NQ.Shutdown(context.Background())
r := chi.NewRouter()
- //r.Use(sessions.LoadAndSave)
+ r.Use(sessions.LoadAndSave)
r.Use(middleware.Logger)
r.Use(middleware.RequestID)
r.Use(middleware.RealIP)
@@ -153,8 +153,8 @@ func main() {
AllowCredentials: true,
AllowedOrigins: []string{"http://localhost:1313", fmt.Sprintf("https://%s", os.Getenv("SITE_DOMAIN"))},
AllowedMethods: []string{"GET", "POST", "PUT", "DELETE", "OPTIONS"},
- AllowedHeaders: []string{"Accept", "Cookie", "Authorization", "Content-Type", "X-CSRF-Token", "hx-target", "hx-current-url", "hx-request"},
- ExposedHeaders: []string{"Link", "HX-Location"},
+ AllowedHeaders: []string{"Accept", "Cookie", "Authorization", "Content-Type", "X-CSRF-Token", "hx-target", "hx-current-url", "hx-request", "hx-trigger", "hx-trigger-name"},
+ ExposedHeaders: []string{"Link", "HX-Location", "Vary", "Access-Control-Allow-Origin"},
MaxAge: 300, // Maximum value not ignored by any of major browsers
}))
@@ -170,7 +170,7 @@ func main() {
})
fmt.Printf("Starting API server on port 1314\n")
- if err := http.ListenAndServe("0.0.0.0:1314", sessions.LoadAndSave(r)); err != nil {
+ if err := http.ListenAndServe("0.0.0.0:1314", r); err != nil {
log.Fatal(err)
}
}