Commit graph

850 commits

Author SHA1 Message Date
Vincent Prouillet
f6c0d52d16 Revert "Allow external links to start with "www.*" (#2100)"
This reverts commit 902fd3a9fb.
2023-03-19 20:36:25 +01:00
François
dd65e99300 Fix index errors (#2129)
* consider sections by path instead of by component

* add tests

* update more tests
2023-03-19 20:36:25 +01: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
64feaeb3ee Pass section.generate_feed 2023-02-24 22:20:26 +01:00
Vincent Prouillet
c67655e29f Fix colocated assets in content directory
Closes #2101
2023-02-24 22:20:26 +01:00
Vincent Prouillet
193d97d930 Update changelog & test-case 2023-02-16 20:49:03 +01:00
Katie Watson
902fd3a9fb Allow external links to start with "www.*" (#2100)
* Make www.* URLs considered valid external links

* Tweak description of is_external_link
2023-02-16 20:49:03 +01:00
Vincent Prouillet
bc27c01024 Remove println 2023-02-16 20:49:03 +01:00
Vincent Prouillet
6b461495fd cargo fmt 2023-02-16 20:49:03 +01:00
Vincent Prouillet
0b31fc10d2 Add test for #1566
Closes #1566
2023-02-16 20:49:03 +01:00
Vincent Prouillet
05ab07bff0 Downgrade mockito to not raise MSRV 2023-02-16 20:49:03 +01:00
Vincent Prouillet
b4a8d3ce75 Update changelog & mockito 2023-02-16 20:49:03 +01:00
Kartavya Vashishtha
3e1f5777f1 feat: External URL redirect (#2080) 2023-02-16 20:49:03 +01:00
Seth Morabito
f4a1e99b98 Page and config authors (#2024) (#2092)
The W3C feed validator fails to validate RSS 2.0 and Atom 1.0 feed
elements that do not contain a valid author. This change adds an
`authors: Vec<String>` to pages, as well as an `author: Option<String>`
to Config that will act as a default to use in RSS and Atom templates if
no page-level authors are specified.
2023-02-16 20:49:03 +01:00
Vincent Prouillet
4cd80a3df2 Update toml lib
Closes #1313
2023-02-16 20:49:03 +01:00
Vincent Prouillet
9f490bfb81 clippy 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
Orson Peters
29cb3fca7a Removed faulty Windows-specific path check/conversion. Fixes #2076. (#2088) 2023-02-16 20:49:03 +01:00
Vincent Prouillet
60d8425470 Errors on empty taxonomies term
Closes #2085
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
ee4cbb649a Handle pages named index.md in sections
Closes #2082
2023-02-16 20:49:03 +01:00
Vincent Prouillet
bb171009a1 Revert "Use reqwest rustls-tls"
This reverts commit 17c8aa77a5.
2023-02-16 20:49:03 +01:00
Vincent Prouillet
a56e4248e1 Remove built-in shortcodes
Bazooka way of fixing #1832
2023-02-16 20:49:03 +01:00
Vincent Prouillet
61570bbf57 Use reqwest rustls-tls
Easier cross-compiling
Closes #1569
2023-02-16 20:49:03 +01:00
Vincent Prouillet
d828d526ca Add plain text syntax alias to text
Closes #1633
2023-02-16 20:49:03 +01:00
Vincent Prouillet
d43b5e12ca fmt + changelog + updates 2023-02-16 20:49:03 +01:00
Orson Peters
84d057fa1e Reduced cachebust fingerprint to be more reasonable (#2074)
* Reduced cachebust fingerprint to be more reasonable.
2023-02-16 20:49:03 +01:00
Vincent Prouillet
0c5ffa8963 Remove code blocks from search index
Kinda closes #1176
2023-02-16 20:49:03 +01:00
Vincent Prouillet
5090c9e965 Use macro for LanguageOptions::merge 2023-02-16 20:49:03 +01:00
Victor Nilsson
2d44fe81f6 Merge default language data with section language data (#2039)
* Merge language data in config.toml
2023-02-16 20:49:03 +01:00
Vincent Prouillet
4aaed16c6d Update base64 2023-02-16 20:49:03 +01:00
Vincent Prouillet
608837cddf Clippy + 1.63 2023-02-16 20:49:03 +01:00
Vincent Prouillet
e12b766e2c Fmt + change min version 2023-02-16 20:49:03 +01:00
Vincent Prouillet
fcbb21abca Replace libsass by grass
Closes #1535
Closes #2022
2023-02-16 20:49:03 +01:00
Vincent Prouillet
c22ee676d3 Update some deps 2023-02-16 20:49:03 +01:00
David Reed
a7433a58d5 Expose markdown config property to templates (#2052)
* Expose the markdown config property to templates

* Document additional strategies for linking code-highlight stylesheets
2023-02-16 20:49:03 +01:00
Felix Zwettler
d0b80654d1 add preserve_dotfiles_in_output configuration option (#1985) 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
Sosthène Guédon
76ca540142 markdown: Fix clippy warnings 2023-02-16 20:49:03 +01:00
Sosthène Guédon
53114533ff imageproc: Fix clippy warning 2023-02-16 20:49:03 +01:00
Sosthène Guédon
e290616fad content: Fix clippy warnings 2023-02-16 20:49:03 +01:00
Sosthène Guédon
3ef719af6a templates: Fix clippy warning 2023-02-16 20:49:03 +01:00
Sosthène Guédon
f877835ed3 Site: fix clippy warnings 2023-02-16 20:49:03 +01:00
Sosthène Guédon
0183ea548a Fix clippy::manual_retain 2023-02-16 20:49:03 +01:00
Sosthène Guédon
faf00d1047 Fix clippy::derive_partial_eq_without_eq 2023-02-16 20:49:03 +01:00
Soso
405dda6722 Cargo fmt (#2009)
* Run cargo fmt

* Add cargo fmt --check to pipeline
2023-02-16 20:49:03 +01:00
mscherer
da5c4c496a Filter more than 1 footnote in summary (#2017)
If the summary contains more than 1 footnote, only the 1st is
removed, and so dangling links exists for all the others.
2023-02-16 20:49:03 +01:00
Sosthene
7000f787b3 Search json index (#1998)
* search: Add support for a JSON index

* docs: Document JSON index for search

* docs: Use lazy-loaded JSON index

* Add elasticlunr prefix to search engine format configuration

This will be useful if support for more search libraries are added in the future
2023-02-16 20:49:03 +01:00
mscherer
291c93e4ba Do not overfilter HTML when removing footnotes (#2008)
If the summary contain HTML using <sup> like "the 1<sup>st</<sup>", it get
filtered as the regexp that remove footnotes is not precise
enough to remove just the footnotes.
2023-02-16 20:49:03 +01:00
Ever
a0f7dfed97 Fix current_url in taxonomy term (#2000)
* Fix current_url in taxonomy term

* add tests
2023-02-16 20:49:03 +01:00
Vincent Prouillet
442d6222a6 Fix test 2023-02-16 20:49:03 +01:00
Jeremy Barbosa
bedc6d7148 Minify embedded css and js with additional lib flags (#1922) 2023-02-16 20:49:03 +01:00
n-tux-tmp
baa473ceea add get_hash function (#1962)
Co-authored-by: Newbyte <newbie13xd@gmail.com>
Co-authored-by: n-tux-tmp <n-tux-tmp@example.com>
Co-authored-by: n-tux-tmp <n-tux-tmp@noreply.example.org>
2023-02-16 20:49:03 +01:00
Ana Hobden
f1b5c2ea74 Use BufWriter in imageproc (#1996)
According to
https://docs.rs/image/0.24.3/image/enum.DynamicImage.html#method.write_to,
it assumes a buffered writer, so we should provide one.

Signed-off-by: Ana Hobden <operator@hoverbear.org>
2023-02-16 20:49:03 +01:00
Vincent Prouillet
9e0f4002b3 Handle colocated links to assets
Solves #1993
2023-02-16 20:49:03 +01:00
ZettaScript
4a6d13f2cb Tera date-locale feature (#1978) 2023-02-16 20:49:03 +01:00
bemyak
aecbc10c9b Add sorting by slug (#1926) 2023-02-16 20:49:03 +01:00
Vincent Prouillet
ee961056c8 Simplify taxonomy term struct 2023-02-16 20:49:03 +01:00
Eric Scouten
5fb0867b3a Get term fn (#1964)
* Add new `get_taxonomy_term` global function

* Update per @Keats feedback to make `page_count` available all the time.
2023-02-16 20:49:03 +01:00
Andrew Browne
7b562fcd2c Add slugify.paths_keep_dates option. Update docs.
Manual testing:

Existing test_site/config.toml

http://127.0.0.1:1111/posts/a-post-with-dates

====

--- a/test_site/config.toml
+++ b/test_site/config.toml
@@ -18,6 +18,7 @@ extra_syntaxes_and_themes = ["syntaxes", "highlight_themes"]

 [slugify]
 paths = "on"
+paths_keep_dates = true
 taxonomies = "on"
 anchors = "on"

http://127.0.0.1:1111/posts/2016-10-08-a-post-with-dates

====

--- a/test_site/config.toml
+++ b/test_site/config.toml
@@ -17,7 +17,8 @@ highlight_theme = "custom_gruvbox"
 extra_syntaxes_and_themes = ["syntaxes", "highlight_themes"]

 [slugify]
-paths = "on"
+paths = "off"
+paths_keep_dates = true
 taxonomies = "on"
 anchors = "on"

http://127.0.0.1:1111/posts/2016-10-08_a-post-with-dates

====

--- a/test_site/config.toml
+++ b/test_site/config.toml
@@ -17,7 +17,8 @@ highlight_theme = "custom_gruvbox"
 extra_syntaxes_and_themes = ["syntaxes", "highlight_themes"]

 [slugify]
-paths = "on"
+paths = "safe"
+paths_keep_dates = true
 taxonomies = "on"
 anchors = "on"

http://127.0.0.1:1111/posts/2016-10-08_a-post-with-dates
2023-02-16 20:49:03 +01:00
Joel Montes de Oca
567f103ee3 Imporved is_colocated_asset_links (#1972)
This PR includes the following:

- Added a check for `../` which would check to see if a file is in a
  _sub_ directory
- Wrote test for `is_colocated_asset_links`

This PR is similare to PR #1969
2023-02-16 20:49:03 +01:00
Vincent Prouillet
584de3adaf Remove logging 2022-08-14 16:08:48 +02:00
Nick Darnell
3fde41b6e5 The Glob library does not work correctly on windows. This changes the approach to use the normal WalkDir crate, and the Globset crate instead to find the filter. This new code correctly compiles sass files across platforms now. (#1950) 2022-08-14 16:08:48 +02:00
Vincent Prouillet
2a445fa4dc Update deps 2022-08-14 16:08:48 +02:00
Radovan Bast
f61e1ba9a2 parse also *.yml file suffix as YAML; closes #1958 (#1959)
previously only files with *.yaml suffix were recognized as YAML
2022-08-14 16:08:48 +02:00
Vincent Prouillet
abafe66a51 Fix overriding built-in shortcodes
Closes #1947
2022-08-14 16:08:48 +02:00
Tristam MacDonald
93d61cdf72 remove string manipulation of paths (#1941)
* remove string manipulation of paths
2022-08-14 16:08:48 +02:00
Vincent Prouillet
18c62315cf Lowercase config.mode 2022-08-14 16:08:48 +02:00
Andrew Browne
e4bab1f21c Cleanup code to generate page slug. (#1936) 2022-08-14 16:08:48 +02:00
Vincent Prouillet
3fa855267e Ensure homepages get their translations filled 2022-07-15 18:00:55 +02:00
Vincent Prouillet
0d4c2e813f Fix some bugs + cargo fmt 2022-07-12 00:09:38 +02:00
Vincent Prouillet
bf7dbfeaae Update pinned rustc version 2022-07-10 16:54:00 +02:00
Vincent Prouillet
342569a92a Update deps 2022-07-10 16:31:09 +02:00
Vincent Prouillet
7208b86d77
Insert anchor as full heading (#1916)
* Add insert_anchor = "heading"

* Update CHANGELOG.md

Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
2022-07-10 15:02:07 +02:00
bemyak
065e8e64e5
Apply orientation transformation based on EXIF data (#1912) 2022-07-07 23:19:13 +02:00
Vincent Prouillet
cec65d0fa7 Stop printing invalid files in dirs
Too many invalid stuff like emacs files
2022-06-23 20:56:42 +02:00
Arnaud Grandville
18e8246fbc
fix windows EOL in markdown files (#1911)
* add a test

* CodeBlock text may be split on multiple parts

The CodeBlock text events are now concatenated and processed in a single stream at the end. cf https://github.com/raphlinus/pulldown-cmark/issues/457
2022-06-23 19:36:33 +02:00
Phil Lord
4f6a1c6bcc
Properly escape anchor names (#1908) 2022-06-21 19:08:16 +02:00
Phil Lord
afc6a71a79
Allow new lines before anchor (#1905)
Previously the heuristic check for links required spaces before the
attribute to ensure that attributes suffixed with `id` were not
identified. This has now been expanded to any white space character to
enable the `id` attribute to start on a new line.
2022-06-21 15:53:07 +02:00
Vincent Prouillet
5873e0319c Add title_bytes sorting method 2022-06-13 23:37:39 +02:00
Vincent Prouillet
4da81eb17e Fix feed location for taxonomies not in the default language 2022-06-13 22:34:47 +02:00
bemyak
d4b5c4fdc4
Make robots.txt compliant with RFC (#1895)
The [RFC](http://www.robotstxt.org/orig.html) mentions only `Disallow`
directive, so it must appear in the file.

`Allow` is an ad hoc agreement between search engines that no all of
them follow.
2022-06-12 21:41:38 +02:00
Vincent Prouillet
094900777b Do not assume themes are present for CSS export
Closes #1884
2022-06-10 20:54:21 +02:00
Vincent Prouillet
04ee5c85a3 Reenable link rewriting for colocated assets
All credits go to https://github.com/getzola/zola/pull/1779
2022-06-10 20:41:24 +02:00
Vincent Prouillet
e8fe51a344 Update changelog and deps 2022-06-10 20:14:38 +02:00
bemyak
49b310764a
Always follow symlinks (#1883) 2022-06-09 21:47:52 +02:00
bemyak
8029cf891a
Fix taxonomy current path (#1882)
* Fix current_path and current_url for taxonomies

* Fix language duplication in get_url fn
2022-06-09 21:47:03 +02:00
bemyak
6989eb73ab
Fix clippy lint warnings (#1888) 2022-06-04 20:29:33 +02:00
Matt Ickstadt
e9e6cadc6c
Update to elasticlunr-rs 3.0.0 (#1873) 2022-06-03 23:25:42 +02:00
Jake G
ed296d72a1
Your message (#1880) 2022-06-03 22:44:29 +02:00
Laurențiu Nicola
a385dbae29
Add rel="alternate" to Atom post links (#1868)
This improves compatibility with some readers, e.g. Miniflux, which otherwise don't detect these.
2022-05-21 23:28:58 +02:00
Vincent Prouillet
76b0b5f5dd Clippy 2022-05-11 22:34:36 +02:00
Vincent Prouillet
1a3b783120 DRY up the external link checking a bit 2022-05-11 22:31:54 +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
Vincent Prouillet
2291c6e9c3 Fix tests 2022-05-10 22:33:57 +02:00
Vincent Prouillet
beb93f2b0a Expose backlinks 2022-05-08 14:10:29 +02:00
Vincent Prouillet
413a68d8b2 Fix tests 2022-05-06 22:55:29 +02:00
Vincent Prouillet
e0043a7351 Ignore section with render=false when looking for path collisions
Closes #1656
2022-05-06 22:45:05 +02:00
Vincent Prouillet
a958305e58 Clone Zola Tera instance for Markdown filter 2022-05-06 22:16:56 +02:00
Vincent Prouillet
ee8de20a6e Update syntect 2022-05-05 23:41:06 +02:00