Commit graph

60 commits

Author SHA1 Message Date
Vincent Prouillet f84ae7c93b Rename all occurrences of gutenberg to zola in code 2018-10-18 22:50:06 +02:00
Vincent Prouillet 652196969c templates folder is now optional for serve
Fix #445
2018-10-11 20:52:42 +02:00
Vladislav Supalov ca982a268f Replace hard-coded directory slash in serve output (#457)
* Replace hard-coded directory slash in serve output
2018-10-02 11:31:18 +02:00
Christian Friedrich Coors 85529186e4 Fix some clippy warnings 2018-09-30 21:15:09 +02:00
Vincent Prouillet 58e2793097 Ignore one more type of emacs temp file 2018-09-13 16:57:38 +02:00
Johan Sigfrids 883357a7dd Handle relative path case 2018-08-05 08:59:56 +03:00
Johan Sigfrids 9be5e640ff Only test windows path handling on windows.
Otherwise Path won't know what to do.
2018-08-04 23:28:39 +03:00
Johan Sigfrids 64ec7e1578 Fix path handling on windows.
Delay turning paths into string. Instead, use methods on Path/PathBuf
to manipulate paths. This way the Rust Path implementation gets to deal with
all werid cross-platform issues.

This should fix #359
2018-08-04 22:47:45 +03:00
Vincent Prouillet a958f96955 Update actix 2018-07-22 12:14:16 +02:00
Owen Nelson 8f460dc28b Custom 404 page now template driven.
Since we are using a builtin template, we can be assured to have the
target file in place. Middleware renamed since it is bound directly to
the concept of handling 404s.
2018-06-25 23:24:57 -07:00
Owen Nelson 7ab22528a5 WIP Custom 404 page.
This is a proposed successor to #296 (rewritten for actix-web, rather
than iron).
2018-06-25 21:47:37 -07:00
eir 17106be497 Send Appropriate Response on Error
Users can now place custom error pages in static/error/<error_code>.html
e.g. static/error/404.html

If no custom page is found, a default plaintext describing the error is served.
2018-06-25 21:42:58 -07:00
Vincent Prouillet 42939b9a66 Fix error and cargo update 2018-06-25 18:08:20 +02:00
Unreal Hoang ffcc455ed5 Fix panicking handling file without extension 2018-06-25 18:07:41 +02:00
Owen Nelson 0e0cd244f3 Fix error handling put in place to side-step a confusing compiler error.
I filed actix/actix-web#261 as per the maintaner's request while
working on #310.

Having looked at the issue this morning, it appeared there was an
implementation to convert `io::Result` into a `Responder`, which kicked
in when I tried to access the `respond_to()` method without getting the
inner type from that first result before hand.
2018-06-25 18:07:41 +02:00
Owen Nelson 45156c46c9 map actix_web::error::Error to std::io::Error as string.
Conversion is by way of the `Display` trait impl since the actix errors
all seem to be more concerned with converting to/from http responses
rather than standard errors.
2018-06-25 18:07:41 +02:00
Owen Nelson 908f16855a Fixes #279 switch from iron to actix-web.
This implementation seems to match the behavior of the previous iron
server.

Static files are rendered as-is, and when a directory is requested, we
attempt to render a `index.html` found inside, or 404 if it's not
present.

The actix docs mention using channels to send a message to the server to
shut it down gracefully while running in another thread (as we're doing
here), but it seems like there would have to be some reorganization in
order to manage this effectively, perhaps holding the channel sender inside
`main.rs` so we can push a message through to the server when the call
to `cmd::serve()` finally returns.

For the time being, I left things without any careful attempts to
cleanup the server thread. This more or less matches the old iron
implementation as far as I can see.

The static file handling in actix is _just_ a little off from what we'd
want.
I left some comments in the source regarding why we can't just use their hook
for directory index redirection.
2018-06-25 18:07:41 +02:00
Vojtech Kral 6662014e55 Add image resizing support #225 2018-06-25 18:05:04 +02:00
Vincent Prouillet b892c07ed3 Don't hardcode the ws port
Closes #282
2018-06-25 17:59:04 +02:00
Vincent Prouillet 50a79c52f3 Fix serve not working with config flag
Closes #294
2018-06-25 17:58:27 +02:00
Vincent Prouillet f1abbd0860 Move copy utils to utils crate 2018-03-20 18:43:17 +01:00
Vincent Prouillet b3b2527c5d TIL about serde default 2018-03-12 20:11:03 +01:00
Andrew Zah f5ced05926 Separate interface and base url for gutenberg serve (#223)
Separate interface and base_url for serve

You can now have a different base_url and listening interface.
The `gutenberg serve` cmd now accepts `-u`/`--base-url`, but it defaults to `127.0.0.1`.
2018-02-02 17:18:07 +01:00
Vincent Prouillet 16f658c70c Move test_site and turn rebuild.rs into a component 2018-01-29 18:40:12 +01:00
Vincent Prouillet a44dd5f49a serve cleans after itself now
Closes #199
2018-01-22 18:11:28 +01:00
Vincent Prouillet f37992e03a Do not unwrap on serve 2018-01-22 13:46:36 +01:00
Thomas Vincent 67eca7731f Reload on config change (#206)
* Trigger rebuild when `config.toml` is edited
2018-01-12 11:50:29 +01:00
Vincent Prouillet 14edd2b875 Add output-dir option to build & serve
From #191
2017-12-29 19:26:17 +01:00
Thomas Vincent 78a3602454 Add the detection of ChangeKind::Sass to tests 2017-11-21 00:05:37 +01:00
Vincent Prouillet 1d8df5774f Allow static folder to be missing 2017-10-25 14:49:54 +02:00
Vincent Prouillet 20c1947b47 Clippy run 2017-10-02 20:16:56 +09:00
Vincent Prouillet a07835bbe3 Ignore folder change on live reload. Close #118 2017-09-12 15:57:51 +09:00
Vincent Prouillet c77cc9b170 First draft of theme support 2017-08-23 19:17:24 +09:00
Vincent Prouillet d78477b619 Add Sass support for *nix 2017-07-06 22:19:50 +09:00
Vincent Prouillet c3b525745e Convert project to a workspace 2017-07-01 16:47:41 +09:00
Vincent Prouillet 2a150299f3 Move cli code to bin directory 2017-05-12 22:59:41 +09:00
Vincent Prouillet c791dffae5 Use livereload properly. Fix #10 2017-05-12 21:15:50 +09:00
Vincent Prouillet f3edef2640 Warn about ignored pages 2017-05-09 21:12:10 +09:00
Vincent Prouillet a3318d4b56 Pagination 2017-05-03 20:00:50 +09:00
Vincent Prouillet 27287a50c3 Do not unwrap on watchers in serve cmd 2017-05-01 18:11:18 +09:00
Vincent Prouillet dd9bab3142 Fix XML template overriding 2017-04-28 16:18:18 +09:00
Erle Carrara 9acb70442f Copy only modified files in static directory (#27)
Copy only static files that triggered the change notification
2017-04-18 14:07:02 +09:00
Vincent Prouillet f44d698844 Add number of pages/section on serve as well 2017-03-25 16:12:58 +09:00
Vincent Prouillet 0aef05ac8e Clippy + appveyor 2017-03-25 15:59:12 +09:00
Vincent Prouillet a02d50c22a Add some colours 2017-03-25 15:52:51 +09:00
Vincent Prouillet 870fbbcd0f Allow selecting a config file other than config.toml 2017-03-25 13:18:15 +09:00
Vincent Prouillet 8b5183d4ad Partial reloading of content on change 2017-03-21 16:57:00 +09:00
Vincent Prouillet eb6fa3c314 Override base_url in serve cmd 2017-03-20 19:20:16 +09:00
Vincent Prouillet 7e496878e5 Sections
Parse _index.md files as sections and render them
2017-03-19 19:20:24 +09:00
Vincent Prouillet 60e30edce0 Make it work on stable 2017-03-10 22:24:56 +09:00