Commit graph

334 commits

Author SHA1 Message Date
Grant Handy
6a612ca388
Simple console error message dialog in zola serve webpages (#2312)
* first attempt at injecting HTML into outgoing webpages

* finish error handling

* fix test_site debug line
2023-09-25 09:46:36 +02:00
Felix Zwettler
5ad9f84a81 fix zola serve not respecting preserve_dotfiles_in_output (#2113)
* fix `zola serve` not  respecting `preserve_dotfiles_in_output`
2023-02-24 22:20:26 +01:00
Vincent Prouillet
b4a8d3ce75 Update changelog & mockito 2023-02-16 20:49:03 +01:00
Vincent Prouillet
b2f8a94b8d Try to disable uninlined format lint 2023-02-16 20:49:03 +01:00
Vincent Prouillet
8ba6c1c2a1 Procimage refactor (#2086)
* Refactor image proc

Closes #2066

* Add colocated_path to shortcodes

Closes #1793
2023-02-16 20:49:03 +01:00
Vincent Prouillet
f363ea1ae8 Filter out temp files or with no extensions from colocated assets 2023-02-16 20:49:03 +01:00
Vincent Prouillet
c22ee676d3 Update some deps 2023-02-16 20:49:03 +01:00
Sosthène Guédon
3430d948f7 Fix needless_borrow warnings 2023-02-16 20:49:03 +01:00
Vincent Prouillet
2aa067d5e3 Fix no-port-append default 2023-02-16 20:49:03 +01:00
Fabiano Frizzo
f7c67f4fd0 Add new flag 'port_append' to give the ability to remove port from base url (#2003) 2023-02-16 20:49:03 +01:00
Vincent Prouillet
95c56d47bf Update deps 2023-02-16 20:49:03 +01:00
Yaroslav
88433b6677 Add flag to override prompt for existing dir (#1986)
* Add flag to override prompt for existing dir

Added --force flag to build subcommand.

* Remove unnecessary 'force' check

* Remove prompt to overwrite directory on build cmd
2023-02-16 20:49:03 +01:00
Marcin Puc
74c090a637 Add completion subcommand (#1968)
* Add completion subcommand

* Remove old completion scripts

* Move completion logic
2023-02-16 20:49:03 +01:00
Vincent Prouillet
c70aaf781e
Merge branch 'master' into next 2022-06-10 21:26:48 +02:00
Jon Jensen
da799ea508
Little exactness tweaks (#1874)
* Correct Windows paths

\\ is only for the beginning of UNC paths, e.g.
\\host-name\share-name\file-path
as per
https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file

* Remove spaces path list using brace expansion

In the shell, spaces are significant in a path with brace expansion, and
break it. (As opposed to in Rust module brace expansion.)
2022-06-09 21:47:37 +02:00
bemyak
6989eb73ab
Fix clippy lint warnings (#1888) 2022-06-04 20:29:33 +02:00
Michael Clayton
6240ed5469
add link_checker settings for external_level and internal_level (#1848)
* add external_level and internal_level

* remove unnecessary debug derive on LinkDef

* clarify doc comment about link check levels

* simplify link checker logging

* add missing warn prefix

* simplify link level logging, remove "Level" from linklevel variants

* remove link level config from test site

* switch back to using bail! from get_link_domain

* move console's deps to libs

* remove unnecessary reference

* calling console::error/warn directly

* emit one error, or one warning, per link checker run

* various link checker level changes

* add docs about link checker levels

* remove accidentally committed test site

* remove completed TODO
2022-05-11 21:54:34 +02:00
Colin Dean
f7f5545bdc
Enables setting base-url to / for relative URLs in serve mode (#1853)
Having to change the base URL to whatever ngrok URL was provisioned for
me was frustrating. This patch enables setting it to `/`, which will
then make the `get_url()` function simply return `/`.
2022-05-10 22:04:40 +02:00
Michael Clayton
44b2f99ab8
fix typo in zola init (#1836) 2022-04-26 23:42:16 +02:00
Vincent Prouillet
27a200bb4e Some more refactoring 2022-04-26 23:13:27 +02:00
Vincent Prouillet
9ab1bf2e4e
Re-organise content and remove slotmap indirection level (#1827) 2022-04-26 20:51:04 +02:00
Vincent Prouillet
c11ae6ef28
Use anyhow (#1816)
Also fixes #1783
2022-04-01 21:37:38 +02:00
Michael Clayton
336a2716e0
switch from chrono to time (#1790)
* switch from chrono to time

* remove some unused time features

* get utc offset before threading begins
2022-03-20 22:01:01 +01:00
Vincent Prouillet
75d9e5a1e1 Fix zola init 2022-03-18 17:45:10 +01:00
Vincent Prouillet
40d7208493 Refactoring rendering tests 2022-03-03 12:41:19 +01:00
Sam Vente
dde3531fd9
Make sure that zola serve/build can start from anywhere inside dir tree (#1761)
* Make sure that zola serve/build can start from anywhere inside dir tree

* make clippy and rustfmt a bit happier

* replace unecessary if-else with unwrap_or and display which path could not get canonicalized if it fails at startup

* canonicalize config_path to avoid crash when config.toml changes
2022-03-03 12:35:29 +01:00
Vincent Prouillet
ae3a8b802e Add libs subcrate (#1747)
* Add libs subcrate

* Remove last direct lazy_static usage

* Update pinned ci version

* Update deps
2022-02-14 11:08:40 +01:00
Scott Stevenson
fd0bcfabe6 Include path separator in log message (#1749)
This adds a path separator between the directory and filenames in the
message printed by `zola serve` to indicate it is listening for changes.

Before:

    Listening for changes in /path/to/dir{config.toml, content, sass, static, templates}

After:

    Listening for changes in /path/to/dir/{config.toml, content, sass, static, templates}
                                         ^
2022-02-14 11:08:40 +01:00
Marcin Puc
0f23a40e3f Update arg parsing to clap v3 (#1717)
* Update arg parsing to clap v3
2022-02-14 11:08:40 +01:00
Vincent Prouillet
c33b67c1bf Ensure zola serve only reads from the public dir 2021-11-23 23:18:51 +01:00
Vincent Prouillet
637b00547a
Shortcodes (#1640)
* Next version

* Added tests for shortcode insertion

* Added TOC tests

* Added test for #1475 and #1355

* Basic internal / external links tests

* Added integration test

* Added pseudocode and started on logos

* Logos parsing for shortcodes

* Fixed string literal parsing

Moved string literal parsing to a new lexer in order to have greater
control of control characters which are parsed. This fixes the bug that
was present in the `string_from_quoted` function and also moves the
`QuoteType` to be in the `ArgValueToken`.

* Moved string literal logic to seperate module

* Added square bracket notation for variables

* Error handling rewritten

Remove the Result from the `fetch_shortcodes` function. Added proper
messages within the internal parsing.

* Reorganized and documented the shortcode submodule

* Added all logic for ShortcodeContext spans

* Added working insertion code for MD files

* Made functions generic over Markdown or HTML

* Add check for embedding bodies

* Structure of main function clear

* Added test for `new_with_transforms` function

* It runs!

* Added the code for handling p-ed html shortcodes

* Removed placeholders in markdown function

* Adjusted integration tests

* fetch_shortcodes now also returns a string

* Start of HTML insertion

* Kinda working everything

* Loading of shortcodes and builtins

* Fix tests

* Some missed fixes

* Tweaks + fmt

* Remove string literal handling

* Fix benches

* Grab shortcode def only once per site

* Fix benches

* Rewrite of parser

* Fix tests

* Add test for #1655

* Re-enable integration test

* Add test for #1601

* Add test for #1600

* Add test for #1500

* Add test for #1320

* Fix test on windows?

Co-authored-by: Gijs Burghoorn <g.burghoorn@gmail.com>
2021-11-19 20:31:42 +01:00
acheronfail
f0b131838f
fix: crash on config change (#1616) 2021-09-11 09:31:34 +02:00
Gijs Burghoorn
eceb1bd79d
Added prompt for when zola build output-dir mentions an existing directory. (#1558)
* Next version

* Added ask prompt for output-dir flag

Added `ask_bool` prompt for `--output-dir` for when the output directory
targeted already exists in the file system.

[Issue: #1378]

* Updated the documentation for #1378

* Added missing "sure" in prompt text

* Added timeout to prompt + dirname

* Fixed complication errors

Co-authored-by: Vincent Prouillet <balthek@gmail.com>
2021-09-04 08:10:02 +02:00
Vincent Prouillet
c1267e8929 Remove number of processed images from logs
Closes #1504
2021-08-24 09:55:39 +02:00
Sam Vente
56dcfecce2
make clippy a bit happier (#1588) 2021-08-18 09:36:51 +02:00
Vincent Prouillet
6a39253e29 Unravel errors on full site rebuild in serve
Closes #1398
2021-08-12 09:27:18 +02:00
Martin Vilcans
17f3fe2bda HTTP 404 instead of empty response if not found (#1580)
Fixes getzola/zola#1578
2021-08-08 10:29:44 +02:00
Luke Cowell
28c3dac0ab use provided config file path instead of name
fixes a bug which made it impossible to specify a configuration file outside of the root directory.
2021-08-08 10:29:44 +02:00
Vincent Prouillet
545e766818 Allow functions to look into current theme static folder
Closes #1416
2021-06-24 23:12:05 +02:00
Vincent Prouillet
0cd1ea9537 Avoid panic on invalid addr 2021-06-24 22:36:51 +02:00
Vincent Prouillet
c728a8692b Clear SITE_CONTENT on full reload 2021-06-07 21:00:00 +02:00
Vincent Prouillet
fe79798b0f Remove unused code + rustfmt 2021-05-23 18:13:28 +02:00
Vincent Prouillet
c393deddd3 Better description for output-dir of zola serve 2021-05-23 14:19:09 +02:00
Avinash Sonawane
70675ff710
Make sure that -i, -p and -u options take mandatory arguments (#1474) 2021-05-23 13:57:49 +02:00
Avinash Sonawane
4140ab7207
Specify default output directory (#1464) 2021-05-21 17:43:41 +02:00
Vincent Prouillet
1fab9c664d Update slotmap + handle in memory XML content type in zola serve
Second part of #1308
2021-05-09 15:57:46 +02:00
Vincent Prouillet
fc808f2aa8 Some clippy fixes 2021-04-07 22:13:15 +02:00
Vincent Prouillet
187bc30f00 Serializing lang aware configs 2021-04-07 22:13:15 +02:00
Vincent Prouillet
86b42fc1ab Move taxonomies to language options dict 2021-04-07 22:13:15 +02:00
Bram Neijt
ba8939b240
If it's a directory, serve index.html instead (#1426) 2021-04-07 21:47:15 +02:00