Commit graph

425 commits

Author SHA1 Message Date
Vincent Prouillet
4bcbf2a545 Update deps 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
502dd92cc6 Next version 2022-02-14 11:08:40 +01:00
Vincent Prouillet
c9bc0a29e4 Ready for release 2022-01-23 14:33:51 +01:00
Vincent Prouillet
a61fa3fd80 That's going to be 0.15.3 2022-01-23 14:33:51 +01:00
Phil Lord
5190b5eba5 Add heuristic checking for HTML anchors (#1716)
* Add heuristic checking for HTML anchors

Previously only anchors specified or generated in markdown could be
linked to, without complaint from the link checker. We now use a
simple heuristic check for `name` or `id` attributes.

Duplicate code has been refactored and all XML anchor checks updated
to use regex rather than substring match.

* Fix regexp and refactor
2022-01-23 14:33:51 +01:00
Vincent Prouillet
1ed1fdbee7 Ready for 0.15.2 2021-12-10 22:04:20 +01:00
Vincent Prouillet
46027ecdb7 Update version 2021-12-07 21:47:39 +01:00
Vincent Prouillet
445a95f22d Update deps 2021-12-05 11:18:04 +01:00
Vincent Prouillet
091995b444 Update deps 2021-11-23 23:24:22 +01:00
Vincent Prouillet
19125e8dd2
Back to pest (#1665) 2021-11-23 22:58: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
Vincent Prouillet
19673f2da8 Update deps 2021-10-19 21:24:21 +02:00
acheronfail
f0b131838f
fix: crash on config change (#1616) 2021-09-11 09:31:34 +02:00
Tim Schumacher
4086b0755a
Support colocating subfolders (#1582)
* Support colocating subfolders

* Adjust tests
2021-09-04 08:23:03 +02:00
Vincent Prouillet
8e40720aca Next 2021-08-24 09:14:18 +02:00
Vincent Prouillet
1249d4dc84 Prepare for 0.14.1 2021-08-24 08:50:44 +02:00
liushuyu
c658d171f8
cargo/manifests: allow user to use native-tls if ring is unsupported (#1587)
* cargo/manifests: allow user to use native-tls ...

... if `ring` can't be used on the user's platform (e.g. mips/ppc/riscv)

* CI: test for native tls build
2021-08-18 15:32:34 +02:00
Vincent Prouillet
88e5c6e167 Update deps 2021-08-12 08:54:55 +02:00
Vincent Prouillet
85f68f87cc Update minify and respect HTML spec 2021-08-09 20:28:17 +02:00
Vincent Prouillet
9275d932e2 Next version 2021-08-08 10:29:44 +02:00
Vincent Prouillet
c0895b62f9 Update deps 2021-07-18 14:03:14 +02:00
Vincent Prouillet
4a87689cfb Add class based syntax higlighting + line numbers (#1531)
* Add class based syntax higlighting + line numbers

* Use fork of syntect for now

* Fix tests

* Fix diff background on inline highlighter

Co-authored-by: evan-brass <evan-brass@protonmail.com>
2021-07-10 08:53:19 +02:00
Vincent Prouillet
ee85300303 Mention load_data only works with utf-8
Closes #1539
2021-06-29 22:24:34 +02:00
Marshall Bowers
93900fb623
Add num_format filter (#1460)
* Add `num_format` filter for displaying formatted numbers

* Register the filter

* Update docs

* Make `locale` argument required

* Revert "Make `locale` argument required"

This reverts commit 9cdbf28591.

* Pull the default locale from the site config

* Add note about defaults to the docs

* Add missing borrow
2021-06-25 10:07:52 +02:00
Vincent Prouillet
c49d62cd1e Update deps 2021-06-24 21:59:41 +02:00
Vojtech Kral
9145af6b3e imageproc things for paths refactor (#1484)
* Move image loading code used by get_image_metadata from templates to imageproc

* resize_image: Compute image resize op beforehand and return metadata to caller

* get_image_metdata: Use a serializable response struct

* imageproc: Add integration tests

* imageproc: Assume webp is lossy

* get_image_metadata: Use webp crate for decoding WebP, image is still not very good at it

* imageproc: Test read_image_dimensions in integration tests

* imageproc: Rename read_image_dimensions() as read_image_metadata()

* imageproc: Fix a regression in hash computation

* imageproc: Don't hardcode hashes in integration tests, pattern match them instead

* imageproc: Style fixes

* imageproc: Fix integration tests on Windows (hopefully)
2021-06-10 10:26:12 +02:00
Vincent Prouillet
7fb99eaa44 Revamp the images template functions 2021-06-10 10:26:12 +02:00
Vincent Prouillet
b0937fa5b7 Some more cleanup 2021-06-10 10:26:12 +02:00
Tim Schumacher
16c123aa20
Include path in the search index with include_path (#1509) 2021-06-02 09:18:39 +02:00
Vincent Prouillet
fe79798b0f Remove unused code + rustfmt 2021-05-23 18:13:28 +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
10c1739c62 Update pinned MSRV 2021-05-05 21:36:56 +02:00
Vincent Prouillet
e92e4f1003 Tweaks to load_data + update deps 2021-04-21 21:43:02 +02:00
Stanislas
47b920777a
link_checking: prevent rate-limiting (#1421)
* link_checking: prevent rate-limiting

Fix for https://github.com/getzola/zola/issues/1056.

- assign all links for a domain to the same thread
- reduce number of threads from 32 to 8
- add sleep between HTTP calls

* Add get_link_domain(), use for loops

* Do not sleep after last link for domain

* Avoid quadratic complexity

* remove prints
2021-04-21 21:13:38 +02:00
Songmin Li
4f7b960985
Fix can not build with indexing-zh (#1433)
* fix can not build zola with search/indexing-zh feature

* fix can not build components/utils after enabled indexing-zh feature

error[E0252]: the name `Deserialize` is defined multiple times
 --> components/utils/src/de.rs:2:5
  |
1 | use serde::{Deserialize, Deserializer};
  |             ----------- previous import of the macro `Deserialize` here
2 | use serde_derive::Deserialize;
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^ `Deserialize` reimported here
  |
  = note: `Deserialize` must be defined only once in the macro namespace of this module
2021-04-19 10:33:12 +02:00
Vincent Prouillet
d3caa56da2 Nest translations in languages options 2021-04-07 22:13:15 +02:00
Vincent Prouillet
975800eb5b Enforce unic valid language codes 2021-04-07 22:13:15 +02:00
Vincent Prouillet
341ac3bfbd
Southerntofu bugfix index translations (#1417)
* Translations are also generated for the index page (fix #1332)

* More tests for translations

* Even better error message

* Update page count for test

* Patch to fix Windows tests

By @mtolk

Co-authored-by: southerntofu <southerntofu@thunix.net>
2021-03-22 20:56:11 +01:00
Marco Tolk
5964fc192c
fixes #1401 (#1404)
Co-authored-by: Marco Tolk <marco@marcotolk.com>
2021-03-11 19:47:42 +01:00
Philip Kristoffersen
8eac5a5994
WebP support in resize_image (#1360)
* Removing unused webpl

* Adding clarification comment

* Updating documentation

* Adding webp
2021-02-18 22:30:10 +01:00
Matt Riggott
a65a2d52c7
Update minify-html dependency to version 0.4.2 (#1340)
* Update minify-html dependency to version 0.4.2

Fixes https://github.com/getzola/zola/issues/1300. See also https://github.com/wilsonzlin/minify-html/issues/21

* Update minify-html dependency in Cargo.lock

* Add test to check pre whitespace isn't collapsed
2021-02-06 16:41:10 +01:00
Vincent Prouillet
8e6c3f4fef Update changelog + deps 2021-02-02 20:25:27 +01:00
David James
92b5b4b3a5
Add sort_by title (#1315)
* Add sort_by=title

* Remove old comment.

* Remove println! debugging

* Minor: text spacing

* Use lexical_sort crate for sort_by title

Co-authored-by: David James <davidcjames@gmail.com>
2021-01-20 15:35:25 +01:00
Vincent Prouillet
96fb798a4a Update test-case 2021-01-17 09:41:33 +01:00
southerntofu
347208f24e serve command respects mime types (closes #1308) 2021-01-15 21:36:07 +01:00
Vincent Prouillet
108986ba6b Next version 2021-01-13 09:26:14 +01:00
Vincent Prouillet
819cfc8ec2 Cargo update 2021-01-09 10:16:50 +01:00
Vincent Prouillet
ccad454922 Percent decode paths on zola serve 2021-01-07 19:16:31 +01:00
Vincent Prouillet
1a36c20bd2 Fix html minification
Closes #1292
2021-01-07 19:04:17 +01:00
Vincent Prouillet
877f441422 Update reqwest 2021-01-05 22:11:15 +01:00
Vincent Prouillet
c4260e091d Update hyper
Not by me: https://github.com/getzola/zola/pull/1246
Can't be arsed to figure out the issue I had with cherry-picking
the commit and submodules.
Originally merged on master by mistake
2021-01-05 22:06:55 +01:00
Aidiakapi
358446a65f
Escape path for live reload. Fix #1247. (#1266)
zola serve's live reload feature used to fail on Windows due to the path
separator (`\`) to not being escaped.
2020-12-23 10:37:05 +01:00
Vincent Prouillet
cc3e4f9133 Update changelog + deps 2020-12-14 20:45:32 +01:00
Kevin Ottens
4754cb5792 Yaml frontmatter (#990)
* Accept dates presented as strings

Still, if we find a string we involve the TOML parser to make sure the
content of said string would be a correct TOML date. In a pure TOML
world this isn't exactly relevant, but this will come in handy when
using a YAML deserializer.

Signed-off-by: Kevin Ottens <ervin@ipsquad.net>

* Add serde_yaml and test-case dependencies

This will be necessary for the YAML frontmatter handling and
corresponding unit tests.

Signed-off-by: Kevin Ottens <ervin@ipsquad.net>

* Add YAML front matter handling

Signed-off-by: Kevin Ottens <ervin@ipsquad.net>

* Switch RawFrontMatter enum to wrap &str instead of String

Signed-off-by: Kevin Ottens <ervin@ipsquad.net>

* Update the documentation to mention YAML frontmatter

This is just a light update on purpose. There would be no point in
pushing YAML too much, this is mainly here to help people with a backlog
of posts to transition.

Signed-off-by: Kevin Ottens <ervin@ipsquad.net>
2020-12-14 20:43:31 +01:00
Vincent Prouillet
f20c52b872 Re-use markdown parser for markdown filter 2020-12-14 20:43:31 +01:00
Vincent Prouillet
94634fe87d Move markdown config to its own section in config.toml 2020-12-14 20:43:31 +01:00
Renato Caldas
2673466998 Add bibtex support to load_data() (#1190)
* Add support for loading Bibtex data.

* Add load_data() documentation for the bibtex format

* Force bibtex tags to be lower case.

Bibtex tags are case-insensitive, and this works around tera's case-sensitiveness.

* Improve the load_data() documentation for the bibtex format
2020-12-14 20:43:31 +01:00
Vincent Prouillet
92282608fe Update changelog 2020-12-14 20:43:31 +01:00
Dark Kirb
361d4d65ab Run cargo update (#1235)
This updates `filetime` to the latest version and fixes #1234

Co-authored-by: Charlotte D <darkkirb@darkkirb.de>
2020-12-14 20:43:31 +01:00
Vladislav Nikonov
b1091bbb45 Implemented emoji aliases support in markdown files (#1194)
* Implemented emoji aliases support in markdown files

* Added emoji aliases rendering unit tests

* Added bench for emoji
2020-12-14 20:43:31 +01:00
Vincent Prouillet
a26422d401 Update changelog 2020-12-14 20:43:31 +01:00
Sam Vente
c40fb91ba8 Make sections draftable (#1218)
* make sections draftable

* add documentation paragraph about drafting sections
2020-12-14 20:43:31 +01:00
Vincent Prouillet
5233cc9585 Next version 2020-12-14 20:42:55 +01:00
Vincent Prouillet
94c016521c Fix zola serve 2020-09-28 09:36:16 +02:00
Vincent Prouillet
0230e3297f Next version 2020-09-27 14:15:44 +02:00
Vincent Prouillet
2fa83af956 Set release date 2020-09-27 11:19:20 +02:00
Vincent Prouillet
7910363d63 Next version is 0.12.1 2020-09-26 14:23:24 +02:00
Vincent Prouillet
59d9d26f0e Fix shortcodes issues with newlines
Closes #1172
2020-09-24 20:02:43 +02:00
John-John Tedro
f9ae897190 Use platform-neutral path comparison for in-memory serving (fixes #1169) (#1175)
This introduces `relative-path`, a crate I've written for the specific
purpose of providing platform-neutral operations over paths the same way
they are used in URLs.

This means that `///hello///` == `/hello`, which should do the same as
the existing stripping minus the platform-specific path separators
causing the [bug being referenced](#1169).
2020-09-22 09:46:22 +02:00
Vincent Prouillet
bff0193df7 Next version 2020-09-22 09:46:22 +02:00
Vincent Prouillet
b854ccae28 Prepare for release 2020-09-04 22:42:07 +02:00
Vincent Prouillet
f786783299 Update pulldown_cmark 2020-09-03 21:22:20 +02:00
Vincent Prouillet
6c2300f916 Disable minify_html for now 2020-09-01 21:07:18 +02:00
Vincent Prouillet
4f5fd63281 Update deps + pinned 2020-08-28 19:49:19 +02:00
areille
0df3631b3d
Add minify support (#1146)
* Doc add a missing arg to `get_taxonomy_url` (#1139)

This feature is already exist, but not in the doc yet

Related #766

* Add minify support

* Add documentation

* Code review

* Fix error in documentation

* Update minify-html to 0.3.6

* Move minify into write_content function

* Fix multiple calls to minify()

* Add test for minified output

* Fix breaking test

Co-authored-by: Ken <2770219+ken0x0a@users.noreply.github.com>
2020-08-28 19:39:19 +02:00
Nathan West
af0dd5ef32
Fixed unsound errors (#1143) 2020-08-20 19:51:17 +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
Peter H. Ezetta
623817120c
Updating filetime to v0.2.12 for OpenBSD support (#1120) 2020-08-11 20:28:14 +02:00
liushuyu
6af7959fce
Making Chinese and Japanese search indexing optional... (#1115)
* This can shave ~80 MB off the binary size while allowing users
  speaking these two languages to easily switch them back on
2020-08-07 17:03:51 +02:00
Vincent Prouillet
b4c5e9a34a Update changelog 2020-07-29 20:49:15 +02:00
Vincent Prouillet
9be7bc074d Extract sass code out of site/lib.rs 2020-07-24 23:46:27 +02:00
Vincent Prouillet
9f20af1521 Update deps 2020-07-22 18:59:21 +02:00
Vincent Prouillet
fb994c71d7 Make search index configurable
Closes #961
2020-06-29 20:02:27 +02:00
Vincent Prouillet
ade442a487 clippy + fmt + fix toml dates in extra arrays
Closes #1048
2020-06-18 21:12:46 +02:00
Matthias
5e31a32166
Add support for SVG files to get_image_metadata (Fixes #769) (#1063)
* Add support for SVG files to `get_image_metadata`

* Add support for SVG files to `get_image_metadata`

* Update documentation after adding SVG support
2020-06-18 11:36:11 +02:00
Vincent Prouillet
351c9b7ff3 Remove ja/zh in search index 2020-06-15 19:14:35 +02:00
Vincent Prouillet
b87f17570f Remove unneeded build_timestamp on config 2020-05-28 09:21:42 +02:00
Vincent Prouillet
eb9e22c14b Update Changelog to mention taxonomy rss 2020-05-27 21:20:24 +02:00
Vincent Prouillet
0d817ee528 Next version 2020-05-25 18:24:19 +02:00
Vincent Prouillet
3a292d294a Prepare for release 2020-05-25 10:26:30 +02:00
Vincent Prouillet
1c867b6028 Update deps 2020-05-24 20:01:43 +02:00
XAMPPRocky
4389a72bdb
Update Cargo.lock (#1034) 2020-05-24 20:01:00 +02:00
Hannu Hartikainen
36ec33f042
Change get_url(cachebust=true) to use a hash (#1032)
Cache-busting was previously done with a compile-time timestamp. Change
to the SHA-256 hash of the file to avoid refreshing unchanged files.

The implementation could be used to add a new global fn (say,
get_file_hash) for subresource integrity use, but that's for another
commit.

Fixes #519.

Co-authored-by: Vincent Prouillet <balthek@gmail.com>
2020-05-23 11:46:50 +02:00
Vincent Prouillet
e1c8c01149 Consistent path for defult index section
Closes #995
2020-05-23 11:43:24 +02:00
Vincent Prouillet
fbf431d612 Update syntect, using rust-onig with bindgen temporarily 2020-05-12 20:07:02 +02:00
Vincent Prouillet
bc496e6101 Update syntaxes and syntect 2020-04-29 22:35:28 +02:00
Sven-Hendrik Haase
e9b47dae59
Remove implicit dependency on openssl-sys (#1001) (#1005) 2020-04-27 09:49:05 +02:00
Vincent Prouillet
56e25132a9 Update deps + fix some misleading doc 2020-04-12 17:21:04 +02:00
Yusuke Tanaka
e3cb4ff0ea
Preserve timestamps when copying files (#974) (#983)
* Preserve timestamps when copying files (#974)

* Do not copy files with the same modification timestamps

* Clean temp dbg!

* Add filesize comparison
2020-04-04 11:05:24 +02:00