Commit graph

56 commits

Author SHA1 Message Date
Avinash Sonawane 70675ff710
Make sure that -i, -p and -u options take mandatory arguments (#1474) 2021-05-23 13:57:49 +02:00
Vincent Prouillet 657905ed6e Remove watch-only 2020-12-22 21:35:15 +01:00
Takayuki Nakata 575c38f9c8 Support output_dir in config.toml 2020-12-14 20:42:55 +01:00
Vincent Prouillet b313c97ceb Fix slugified taxonomies rendering
Closes #1177
2020-09-22 09:46:22 +02:00
Vincent Prouillet 278cc82fc7
Change zola serve to load HTML from memory instead of disk (#1114)
* Change zola serve to load HTML from memory instead of disk

* Be smart about assets copying

* Be a tiny bit smarter on template changes

* Add zola serve --fast
2020-08-16 18:39:04 +02:00
southerntofu b003a47d54
Support relative links for root directory (fix #1028) (#1106)
* serve command works from another working directory

* Root dir path is expanded (canonicalized) for relative links (#1028)

* Simplify watchers code

* Only watch sass/themes folders when they are enabled in config

Co-authored-by: southerntofu <southerntofu@thunix.net>
2020-07-29 20:08:25 +02:00
Per Lundberg 530f918955
Add --force/-f flag to init, for creation in non-empty dir (#1065) 2020-06-18 21:15:46 +02:00
Tymoteusz Wiśniewski 974ae167a8
Make path to config.toml independent from root dir (#1023)
fixes #1022
2020-05-23 11:55:45 +02:00
ethereal 94445ae745 Add --root global argument. Fixes #899. (#932) 2020-02-02 17:48:43 -08:00
Sam Ford e804f907b2 Use Rust 2018 edition (#885) 2020-02-02 17:48:43 -08:00
Vincent Prouillet b396a1bc20 Add --drafts flag + rustfmt 2019-08-24 22:23:08 +02:00
Vincent Prouillet 0e4e0c35b3 Remove all draft specific code 2019-07-19 11:10:28 +02:00
Tim Visée 90dad05c67 Add --open flag to serve command, to open URL in default browser (#739)
* Add --open flag to serve command, to open URL in default browser

* Mention serve --open flag in CLI documentation
2019-07-12 22:54:18 +02:00
Vincent Prouillet 9df9465080 Only check for port availability when not in watch-only for serve
Closes #712
2019-06-21 20:02:51 +02:00
Sam Ford 39f97f1520
Update actix-web to 1.0
* actix_web::fs is now found in the actix-files crate.

* NotFoundHandler is now implemented using ErrorHandlers and the
path to 404.html is provided to the not_found() function using
actix_web::App::data. This setup allows for additional StatusCodes
to be handled in the future, if desired.

* Cleanly serving index.html files for requests to directories now
appears to be possible simply by using index_file("index.html") in
the static files service, so handle_directory() is removed.
2019-06-18 19:05:00 -04:00
Marcus Klaas de Vries 0d964204c3 Check command global (#683)
* Add check subcommand

* Add some brief documentation for the check subcommand

* Start working on parallel link checks

* Check all external links in Site

* Return *all* dead links in site
2019-05-27 14:05:07 +02:00
Vincent Prouillet debe0633bc Revert "Allow default base-path command line option to be set for building and serving"
This reverts commit 1815155c1d.
2019-04-20 12:50:34 +02:00
Blake Smith 1815155c1d Allow default base-path command line option to be set for building and serving 2019-03-23 20:25:56 -05:00
Robert Masen e0f90eed4a remove debug-println! 2018-11-01 17:52:23 -05:00
Robert Masen b7c3d7199d add --watch-only flag 2018-11-01 17:20:35 -05:00
Vincent Prouillet b7ce4e59fb rustfmt 2018-10-31 08:18:57 +01:00
Jake Howard aad12d829f Remote data (#494) 2018-10-29 20:13:09 +01:00
Vincent Prouillet 4c9fd0d302 Do not panic if something is already bound to 1111 in serve 2018-10-19 16:33:11 +02:00
Vincent Prouillet 10aba20fe5 Slotmap refactor 2018-10-03 16:29:29 +02:00
Greizgh b8233af2c4 Allow to disable colors through env vars
- unless forced, only use colors in tty
- support CLICOLOR and NO_COLOR vars
- switch to termcolor crate to handle output coloring
2018-09-24 19:19:34 +02:00
Vincent Prouillet a958f96955 Update actix 2018-07-22 12:14:16 +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
Vincent Prouillet 2eacb8247b Fix config CLI option
Closes #254
2018-03-16 19:11:12 +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 14edd2b875 Add output-dir option to build & serve
From #191
2017-12-29 19:26:17 +01:00
Vincent Prouillet 73797efe90 Add a base-url flag to the build command 2017-10-05 10:56:13 +09:00
Vincent Prouillet 23e4b911e7 Improve gutenberg init
Fix #104
2017-07-27 18:28:06 +09:00
Vincent Prouillet 2ea77f3883 Generate completions for all shells 2017-07-15 13:24:31 +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 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 2d26bf038c Force refresh on content/template change and various fixes 2017-03-10 21:36:43 +09:00
Vincent Prouillet a57baf2934 Refactor serve/rebuilding a bit 2017-03-10 20:39:58 +09:00
Vincent Prouillet 478e7054de More precise time and show what changed 2017-03-08 14:00:54 +09:00
Vincent Prouillet e68af48eb6 Make gutenberg a lib as well 2017-03-08 09:13:50 +09:00
Vincent Prouillet a99f084ee2 Code highlighting 2017-03-07 21:37:07 +09:00
Vincent Prouillet 4acce865b4 Sort by date 2017-03-06 22:18:03 +09:00
Vincent Prouillet f57912f712 Basic livereload 2017-03-06 19:35:56 +09:00
Vincent Prouillet e948df1028 Add a Site struct that knows how to parse/build a site 2017-03-03 17:24:08 +09:00
Vincent Prouillet 91fa7e358c Started working on gutenberg again 2017-02-24 11:21:58 +09:00
Vincent Prouillet cbe1691f36 Rename new command to init 2016-12-19 16:58:03 +09:00