Commit graph

581 commits

Author SHA1 Message Date
Vincent Prouillet 25ef603990 Error on invalid file/section 2021-03-06 23:00:56 +01:00
snake66 67f9b9499b
Fix language specific non-internal urls for get_url. (#1381)
* Fix language specific non-internal urls for get_url.

* get_url: PathBuf for URL's don't work on Windows.
2021-03-06 22:49:04 +01:00
Vincent Prouillet 2a46e07e74 Add path to TaxonomyTerm
Closes #1336
2021-02-22 21:27:52 +01:00
Vincent Prouillet 7fc7ef4720 Add tests for slug strategy in filenames with dates 2021-02-22 20:39:31 +01:00
Vincent Prouillet 2bbd3bd424 Fix compute_hash 2021-02-21 09:09:02 +01:00
Vincent Prouillet 3262f69bb0 Single compute_hash fn + cargo fmt 2021-02-20 14:07:36 +01:00
Skyper d3ab3936de
[WIP] Add support for base64-encoded hash values to 'get_file_hash' (#1339)
* Add support for base64-encoded hash values

The global template function 'get_file_hash' can now return a
base64-encoded hash value when its 'base64' parameter is set to true.

See discussion in #519.

* Fix integrity attribute's value in test site

SRI hash values must be base64-encoded.

* Update documentation about 'get_file_hash'

* Fix 'can_get_hash_for_static_files' unit test
2021-02-20 13:31:37 +01:00
Hanno Braun 6d6df45f23
Make shortcodes work in markdown filter (#1358)
* Move `load_tera` to `templates`

I don't know if this is a good place for it, conceptually. I'm moving it
there because I need to use it from `templates`, and `templates` can't
depend on `site`, because there's already a dependency in the opposite
direction.

* Load templates in `markdown` filter

This enables the `markdown` filter to handle shortcodes, as long as
those shortcodes don't access any context variables.

Addresses #1350

* Update documentation of `markdown` filter

* Only load templates for `markdown` filter once

* Clarify `markdown` filter documentation

This is a lightly edited version of what @southerntofu suggested.
2021-02-19 20:51:08 +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
Chiu-Hsiang Hsu 3cb61c3bcd
Support embed YouTube playlist (#1342) 2021-02-07 17:13:03 +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
southerntofu 53456bd052
Don't panic for missing highlight theme (close #1299) (#1307)
* No panic when markdown.highlight_theme is missing

* Better error message for missing theme

* Better error messages

Co-authored-by: southerntofu <southerntofu@thunix.net>
2021-02-04 09:54:12 +01:00
Vincent Prouillet aa57541c21 Force newline after front-matter
Closes #1287
2021-02-02 21:53:37 +01:00
Vincent Prouillet 024144ba78 cargo fmt 2021-02-02 20:49:57 +01:00
Vincent Prouillet 34989a8ef6 Fix panic in loading Page
Closes #1327
2021-02-02 20:48:32 +01:00
Vincent Prouillet 8e6c3f4fef Update changelog + deps 2021-02-02 20:25:27 +01:00
southerntofu 15e0ae6699
load_data() template function takes a required boolean flag (closes #1209) (#1306)
* load_data() template function takes a `required` boolean flag

* Update tests for load_data()

* Add test to make sure invalid data always fails in load_data

* Better documentation, fixing a few typos

Co-authored-by: southerntofu <southerntofu@thunix.net>
2021-02-02 20:19:44 +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
southerntofu 6950759eda
Internal links are supported in markdown filter (#1318)
* Internal links are resolved in tera markdown filter (close #1296 #1316)

* Add a test for internal links in markdown filter

Co-authored-by: southerntofu <southerntofu@thunix.net>
2021-01-20 09:24:55 +01:00
southerntofu 14366dafc6
Fix fallback to syntax highlighting theme (closes #1309) (#1312)
* Highlight fallback from extra syntaxes to the theme (close #1309)

* Warning when codeblock language is unknown and cannot be highlighted

* page/section path in codeblock language missing warning

Co-authored-by: southerntofu <southerntofu@thunix.net>
2021-01-18 09:35:17 +01:00
Vincent Prouillet 96fb798a4a Update test-case 2021-01-17 09:41:33 +01:00
Musee Ullah 0a5181d621
Ensure minified HTML is truncated before converting to String
Closes #1304
2021-01-12 21:03:49 -06:00
Vincent Prouillet 779a15a500 Pass lang to 404
Closes #1281
2021-01-09 10:21:50 +01:00
Vincent Prouillet 819cfc8ec2 Cargo update 2021-01-09 10:16:50 +01:00
Vincent Prouillet 1a36c20bd2 Fix html minification
Closes #1292
2021-01-07 19:04:17 +01:00
Vincent Prouillet aa03a7fec5 Fix highlighting
Closes #1291
2021-01-07 11:34:48 +01:00
Vincent Prouillet 877f441422 Update reqwest 2021-01-05 22:11:15 +01:00
Vincent Prouillet 6622078038 DRY things a bit 2021-01-05 21:48:35 +01:00
Sam Vente 369fb40dfe
move translation population and path collision checking to insert stage (#1272) 2021-01-05 21:39:25 +01:00
Vincent Prouillet b9b4ef9f04 Add data-lang on code blocks 2021-01-02 09:29:28 +01:00
Vincent Prouillet 7540ecd58e Prefer custom syntax before built-in ones 2020-12-29 10:36:40 +01:00
Vincent Prouillet 2362cf2415 Move syntaxes around to make packing a two step process
Closes #1268
2020-12-28 17:39:54 +01:00
Vincent Prouillet 657905ed6e Remove watch-only 2020-12-22 21:35:15 +01:00
Vincent Prouillet 39870d8675 Move extra_syntax to markup.rs 2020-12-21 08:54:43 +01:00
Vincent Prouillet 96439df0e2 Add some debug log time 2020-12-21 08:54:35 +01:00
Vincent Prouillet fc8b4066f2 Update syntaxes + replace js lang in rendering
Closes #1241, #1211
2020-12-15 10:42:35 +01:00
Vincent Prouillet 68cdfcbbe7 Fix panic with misnamed index section
Closes #1244
2020-12-14 22:51:30 +01:00
Nathanael Lane a210abc5a3 Add shortcode 'invocation' variable to allow a shortcode to track how… (#1236)
* add shortcode 'invocation' variable to allow a shortcode to track how many times it has been invoked in a given Markdown file

* use closure (implicit struct) instead of explicit struct for invocation tracking

* update variable name to "nth"
2020-12-14 20:43:32 +01:00
Sylvain Kerkour a93063ba4a search: Update elasticlunr.min.js to 0.9.6 (#1260) (#1261) 2020-12-14 20:43:32 +01:00
Rostislav 679af5b8c8 add Allow: / to default robots.txt template (#1258)
Also update the documentation about it.
2020-12-14 20:43: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 59d3d8a3da Enable smart punctuation
Closes #740
2020-12-14 20:43:31 +01:00
Vincent Prouillet e58c2d6b6c More details on fs errors 2020-12-14 20:43:31 +01:00
Vincent Prouillet 2c681f3439 Add some external link markdown tweaking options
Closes #681, #695
2020-12-14 20:43:31 +01:00
Vincent Prouillet 047ce32efd Clippy 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
Basix 944cba030e Allow to specify default language in filenames (#1233)
* Use default language if code is same as default

* Add test for specifying default locale

* Update docs to mention default languages
2020-12-14 20:43:31 +01:00