Generate a bundle that includes markdown files (needed for dynamic
markdown rendering). In future these will be compiled into static
outputs by the bundle command but for now we copy them into the source
tree. `bundle.tar.gz` includes one directory which is named after the
compiled exe, containing a `server` executable, `public` and `static`
directories, and any markdown files.
Windows support removed for now - will re-add when we overhaul all of
this to no longer do command line invocation of `tar` (we will build
tarball/Zip file ourselves).
When query param is empty, use `jetzig.data.Data.NullType` - this way
the value is still non-null (i.e. can be captured) and is still a
`jetzig.data.Value` so is consistent with previous implementation.
Add very weird bugfix for 404 responses.
Fix `Bad Request` response code.
If no template present, allow the request to render the view and then
only render a 404 if the view does not redirect, otherwise all views
would need a placeholder Zmpl template even if the view does not use it.
Also parse HTTP body as query string if present.
Generate an array of `jetzig.views.Route` in `GenerateRoutes.zig` exe
instead of a meta-route that we later translate into an actual route.
This makes things much simpler for static routes at build time and
dynamic routes at run time as we no longer need to use comptime - we
just have an array of routes ready-made.
If a route isn't matched but the URI can match directly to a markdown
file, render it directly. This allows putting arbitrary markdown files
in e.g. `/foo/bar/abc.md`, `/foo/bar/def.md` and rendering them as
`/foo/bar/abc.html`, `/foo/bar/def.html`. Since markdown are static
content only (i.e. no template data etc.) it makes sense for them to be
renderable without needing to create a view for each one.
When zig build fails, the `jetzig server` command also exits. This
should be an uninteneded behavior. This commit fixes this by catching
failed build and restart after file change is detected.
Fixes#33
The compiler doesn't pass color to the parent process unless it is
called with `--colour on`. This commit adds those arguments to add
support for coloring in compiler outputs.
Don't use stderr for error logfile if primary logfile is not stdout
(i.e. always use the same file).
Fix non-colorized duration in DeveolpmentLogger - use std.fmt.fmtDurationSigned.
When `HX-Target` header is present, bypass any configured layout for the
request. This allows a full page reload to render with a layout, i.e.
render the entire page, while a request from htmx will load just the
content directly generated by the view.