Boost everything

This commit is contained in:
Adriano Caloiaro 2023-08-01 09:44:04 -06:00
parent 8056924f85
commit 532b1104dc
No known key found for this signature in database
GPG key ID: C2BC56DE73CE3F75
4 changed files with 10 additions and 7 deletions

View file

@ -28,7 +28,7 @@ title: Create Account
<label for="password">Password</label>
<input
id="password
id="password"
type="password"
name="password"
placeholder="desired password"
@ -39,7 +39,7 @@ title: Create Account
<label for="password_confirmation">Password Confirmation</label>
<input
id="password_confirmation"
type="text"
type="password"
name="password_confirmation"
placeholder="desired password again"
hx-post="{{ .Site.Params.apiBaseUrl }}/users/new_user_validation"

View file

@ -94,12 +94,12 @@ enableInlineShortcodes = true
[[languages.en.menu.main]]
identifier = "dictionary"
name = "Dictionary"
url = "/dictionary"
url = "/dictionary/"
[[languages.en.menu.main]]
identifier = "faq"
name = "FAQ"
url = "/faq"
url = "/faq/"
weight = 2
[module]

View file

@ -184,7 +184,7 @@ 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", "hx-trigger", "hx-trigger-name"},
AllowedHeaders: []string{"Accept", "Cookie", "Authorization", "Content-Type", "X-CSRF-Token", "hx-target", "hx-current-url", "hx-request", "hx-trigger", "hx-trigger-name", "hx-boosted"},
ExposedHeaders: []string{"Link", "HX-Location", "Vary", "Access-Control-Allow-Origin"},
MaxAge: 300, // Maximum value not ignored by any of major browsers
}))
@ -481,7 +481,9 @@ func loginHandler(w http.ResponseWriter, r *http.Request) {
// logoutHandler handles users logout requests
func logoutHandler(w http.ResponseWriter, r *http.Request) {
sessions.Destroy(r.Context())
http.Redirect(w, r, appURL(), http.StatusFound)
w.Header().Add("hx-location", appURL())
w.WriteHeader(http.StatusOK)
}
// navUserItems returns a nav items depending on whether the user is logged in

View file

@ -6,7 +6,8 @@
{{ end }}
{{ partial "head.html" . }}
</head>
<body class="{{- ( or .Params.color $.Site.Params.ThemeColor ) -}}" hx-select-oob="#alert" hx-ext="remove-me">
<body class="{{- ( or .Params.color $.Site.Params.ThemeColor ) -}}" hx-select-oob="#alert" hx-ext="remove-me"
hx-boost="true">
{{ $container := cond ($.Site.Params.FullWidthTheme | default false) "container full" (cond ($.Site.Params.CenterTheme | default false) "container center" "container") }}
<div class="{{- $container -}}{{- cond ($.Site.Params.oneHeadingSize | default true) " headings--one-size" "" }}">