feat: add base_path support for mounting under a URL prefix
Wraps the router in axum's `nest` when BOOK_BASE_PATH is set, prepends
the prefix to form actions and asset URLs, and exposes a {{base}}
template placeholder. basePath option added to the NixOS module.
This commit is contained in:
parent
b784f4dd9c
commit
6ca40e2321
9 changed files with 251 additions and 14 deletions
|
|
@ -15,6 +15,8 @@
|
|||
entries - Approved guestbook entries, newest first.
|
||||
style - Custom CSS from BOOK_STYLE or BOOK_STYLE_FILE, wrapped in
|
||||
a <style> tag. Uses built-in default.css when neither is set.
|
||||
base - URL prefix the guestbook is mounted at (BOOK_BASE_PATH).
|
||||
Empty when serving at the domain root.
|
||||
|
||||
See default.css for available CSS classes on rendered elements.
|
||||
-->
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
title - Site title (BOOK_SITE_TITLE).
|
||||
style - Custom CSS (same as the main template).
|
||||
base - URL prefix the guestbook is mounted at (BOOK_BASE_PATH).
|
||||
|
||||
Everything else is static — write whatever you want. Use <script> for
|
||||
dynamic behavior like showing the current time.
|
||||
|
|
@ -21,7 +22,7 @@
|
|||
<body>
|
||||
<div class="page-container">
|
||||
<p>Thanks! Your message is pending approval.</p>
|
||||
<p><a href="/">← back</a></p>
|
||||
<p><a href="{{base}}/">← back</a></p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue